-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix NOSE_TESTMATCH default regex. #950
Conversation
See bug #11.
@kengruven I've had a look at this - looks good. I might suggest changing the Config class docstring to include the |
Tony, good call. I've made the change you suggested. |
I'm not familiar enough with nose's CI tests to understand why this failed, but it doesn't seem to have anything to do with this PR. (All I did was change a docstring!) The Python 3.2 test failed in 'coverage', which uses a u''-style string, which isn't valid syntax on that particular version. PR #951 (completely unrelated) is failing for the same reason. |
@@ -217,7 +217,7 @@ Options | |||
|
|||
Files, directories, function names, and class names that match this | |||
regular expression are considered tests. Default: | |||
(?:^|[b_./-])[Tt]est [NOSE_TESTMATCH] | |||
(?:\b|_)[Tt]est [NOSE_TESTMATCH] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You edited this by hand, but it's a generated file. Run make -C doc readme
to update it correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run that, it comes out as:
Files, directories, function names, and class names that match this
regular expression are considered tests. Default: (?:b|_)[Tt]est
[NOSE_TESTMATCH]
i.e., the backslash is missing. Is that a Sphinx bug?
Maybe that's why the original had doubled backslashes -- they were trying to get it to show up correctly in the README. Even with 4 backslashes, I can't get it to render a backslash in README.txt, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This helps:
diff --git a/nose/config.py b/nose/config.py
index 5997aaf..7609f35 100644
--- a/nose/config.py
+++ b/nose/config.py
@@ -499,7 +499,8 @@ class Config(object):
dest="testMatch", metavar="REGEX",
help="Files, directories, function names, and class names "
"that match this regular expression are considered tests. "
- "Default: %s [NOSE_TESTMATCH]" % self.testMatchPat,
+ "Default: %s [NOSE_TESTMATCH]" % (
+ self.testMatchPat.replace('\\', '\\\\'),),
default=self.testMatchPat)
parser.add_option(
"--tests", action="store", dest="testNames", default=None,
It means that you see a double backslash in nosetests -h
though--but I don't think it's worth worrying about... it communicates what it needs to.
This fixes the top half of nosetests.1 and README.txt.
This fixes the -m flag documentation for both the README.txt and nosetests.1 manpage.
OK, I've convinced myself it's not a Sphinx bug. It's was mostly an issue with how nose's OptBucket makes text for Sphinx to parse. This should fix the backslash problem in all 5 places (top of manpage, bottom of manpage, top of README, bottom of README, It's not the prettiest thing I've ever written, and I'm not terribly familiar with the Nose internals, so improvements are welcome. |
Looks good. Thanks. |
Fix NOSE_TESTMATCH default regex.
See bug #11.
I don't know if this is exactly what's needed, but let's get this party started.