summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Harris <kengruven@gmail.com>2015-11-11 09:48:04 -0800
committerKen Harris <kengruven@gmail.com>2015-11-11 09:48:04 -0800
commitca3e447f65d7aa90c73593ba99f2ea9e95d8ed99 (patch)
tree8b75a06dad871678e20b6f629aeb78bf264f2f9f
parent56d64c0bb8c171471607506c07c875763464e629 (diff)
downloadnose-ca3e447f65d7aa90c73593ba99f2ea9e95d8ed99.tar.gz
Escape backslashes for Sphinx, in OptBucket
This fixes the -m flag documentation for both the README.txt and nosetests.1 manpage.
-rw-r--r--README.txt4
-rw-r--r--nose/sphinx/pluginopts.py2
-rw-r--r--nosetests.12
3 files changed, 5 insertions, 3 deletions
diff --git a/README.txt b/README.txt
index c7d6624..e8650e0 100644
--- a/README.txt
+++ b/README.txt
@@ -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/sphinx/pluginopts.py b/nose/sphinx/pluginopts.py
index d2b284a..4960b92 100644
--- a/nose/sphinx/pluginopts.py
+++ b/nose/sphinx/pluginopts.py
@@ -157,6 +157,8 @@ class OptBucket(object):
return self.doc.replace('%prog', self.prog).replace(':\n', '::\n')
def add_option(self, *arg, **kw):
+ kw = {k: (v.replace('\\', '\\\\') if isinstance(v, str) else v)
+ for (k, v) in kw.items()}
self.opts.append(Opt(*arg, **kw))
diff --git a/nosetests.1 b/nosetests.1
index f1a0c44..cddb6e3 100644
--- a/nosetests.1
+++ b/nosetests.1
@@ -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