Skip to content

Commit

Permalink
Escape backslashes for Sphinx, in OptBucket
Browse files Browse the repository at this point in the history
This fixes the -m flag documentation for both the README.txt and
nosetests.1 manpage.
  • Loading branch information
kengruven committed Nov 11, 2015
1 parent 56d64c0 commit ca3e447
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions nose/sphinx/pluginopts.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ def format_help(self):
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))


Expand Down
2 changes: 1 addition & 1 deletion nosetests.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca3e447

Please # to comment.