summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.txt8
-rw-r--r--nose/config.py5
-rw-r--r--nose/sphinx/pluginopts.py3
-rw-r--r--nose/usage.txt2
-rw-r--r--nosetests.16
5 files changed, 13 insertions, 11 deletions
diff --git a/README.txt b/README.txt
index 2b6273f..e8650e0 100644
--- a/README.txt
+++ b/README.txt
@@ -51,8 +51,8 @@ nose collects tests automatically from python source files,
directories and packages found in its working directory (which
defaults to the current working directory). Any python source file,
directory or package that matches the testMatch regular expression (by
-default: *(?:^|[b_.-])[Tt]est)* will be collected as a test (or source
-for collection of tests). In addition, all other packages found in the
+default: *(?:\b|_)[Tt]est* will be collected as a test (or source for
+collection of tests). In addition, all other packages found in the
working directory will be examined for python source files or
directories that match testMatch. Package discovery descends all the
way down the tree, so package.tests and package.sub.tests and
@@ -216,8 +216,8 @@ Options
-m=REGEX, --match=REGEX, --testmatch=REGEX
Files, directories, function names, and class names that match this
- regular expression are considered tests. Default:
- (?:^|[b_./-])[Tt]est [NOSE_TESTMATCH]
+ regular expression are considered tests. Default: (?:\b|_)[Tt]est
+ [NOSE_TESTMATCH]
--tests=NAMES
diff --git a/nose/config.py b/nose/config.py
index 125eb55..5997aaf 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(env.get('NOSE_TESTMATCH', 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'
diff --git a/nose/sphinx/pluginopts.py b/nose/sphinx/pluginopts.py
index d2b284a..2f6e895 100644
--- a/nose/sphinx/pluginopts.py
+++ b/nose/sphinx/pluginopts.py
@@ -157,6 +157,9 @@ class OptBucket(object):
return self.doc.replace('%prog', self.prog).replace(':\n', '::\n')
def add_option(self, *arg, **kw):
+ for k, v in kw.items():
+ if isinstance(v, str):
+ kw[k] = v.replace('\\', '\\\\')
self.opts.append(Opt(*arg, **kw))
diff --git a/nose/usage.txt b/nose/usage.txt
index bc96894..5e1d914 100644
--- a/nose/usage.txt
+++ b/nose/usage.txt
@@ -2,7 +2,7 @@ nose collects tests automatically from python source files,
directories and packages found in its working directory (which
defaults to the current working directory). Any python source file,
directory or package that matches the testMatch regular expression
-(by default: `(?:^|[\b_\.-])[Tt]est)` will be collected as a test (or
+(by default: `(?:\\b|_)[Tt]est` will be collected as a test (or
source for collection of tests). In addition, all other packages
found in the working directory will be examined for python source files
or directories that match testMatch. Package discovery descends all
diff --git a/nosetests.1 b/nosetests.1
index 5772845..cddb6e3 100644
--- a/nosetests.1
+++ b/nosetests.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "NOSETESTS" "1" "April 04, 2015" "1.3" "nose"
+.TH "NOSETESTS" "1" "November 11, 2015" "1.3" "nose"
.SH NAME
nosetests \- Nicer testing for Python
.
@@ -43,7 +43,7 @@ nose collects tests automatically from python source files,
directories and packages found in its working directory (which
defaults to the current working directory). Any python source file,
directory or package that matches the testMatch regular expression
-(by default: \fI(?:^|[b_.\-])[Tt]est)\fP will be collected as a test (or
+(by default: \fI(?:\eb|_)[Tt]est\fP will be collected as a test (or
source for collection of tests). In addition, all other packages
found in the working directory will be examined for python source files
or directories that match testMatch. Package discovery descends all
@@ -236,7 +236,7 @@ Look for tests in this directory under Python 3.x. Functions the same as \(aqwhe
.INDENT 0.0
.TP
.B \-m=REGEX, \-\-match=REGEX, \-\-testmatch=REGEX
-Files, directories, function names, and class names that match this regular expression are considered tests. Default: (?:^|[b_./\-])[Tt]est [NOSE_TESTMATCH]
+Files, directories, function names, and class names that match this regular expression are considered tests. Default: (?:\eb|_)[Tt]est [NOSE_TESTMATCH]
.UNINDENT
.INDENT 0.0
.TP