summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Harris <ken@livestories.com>2015-09-15 14:13:36 -0700
committerKen Harris <ken@livestories.com>2015-09-15 14:13:36 -0700
commita25c9d62e6f05932872010cb39d101179f20181f (patch)
tree668a234f69d4257dc6b4337c743e2146aba5a5d3
parent716d822d43db30195f795daa9fd71d54e682ec0c (diff)
downloadnose-a25c9d62e6f05932872010cb39d101179f20181f.tar.gz
Fix NOSE_TESTMATCH default regex.
See bug #11.
-rw-r--r--README.txt2
-rw-r--r--nose/config.py5
2 files changed, 3 insertions, 4 deletions
diff --git a/README.txt b/README.txt
index 2b6273f..a8cc961 100644
--- a/README.txt
+++ b/README.txt
@@ -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]
--tests=NAMES
diff --git a/nose/config.py b/nose/config.py
index 125eb55..72554a5 100644
--- a/nose/config.py
+++ b/nose/config.py
@@ -147,7 +147,7 @@ class Config(object):
self.env = env = kw.pop('env', {})
self.args = ()
- self.testMatch = re.compile(r'(?:^|[\\b_\\.%s-])[Tt]est' % os.sep)
+ self.testMatch = re.compile(r'(?:\b|_)[Tt]est')
self.addPaths = not env.get('NOSE_NOPATH', False)
self.configSection = 'nosetests'
self.debug = env.get('NOSE_DEBUG')
@@ -180,8 +180,7 @@ class Config(object):
def __init__(self, **kw):
self.env = env = kw.pop('env', {})
self.args = ()
- self.testMatchPat = env.get('NOSE_TESTMATCH',
- r'(?:^|[\b_\.%s-])[Tt]est' % os.sep)
+ self.testMatchPat = env.get('NOSE_TESTMATCH', r'(?:\b|_)[Tt]est')
self.testMatch = re.compile(self.testMatchPat)
self.addPaths = not env.get('NOSE_NOPATH', False)
self.configSection = 'nosetests'