From ca3e447f65d7aa90c73593ba99f2ea9e95d8ed99 Mon Sep 17 00:00:00 2001 From: Ken Harris Date: Wed, 11 Nov 2015 09:48:04 -0800 Subject: Escape backslashes for Sphinx, in OptBucket This fixes the -m flag documentation for both the README.txt and nosetests.1 manpage. --- README.txt | 4 ++-- nose/sphinx/pluginopts.py | 2 ++ nosetests.1 | 2 +- 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 -- cgit v1.2.1