Show More
@@ -68,20 +68,26 b' testmod_arg_overrides = {' | |||||
68 | 'tests.test-url': [{'optionflags': doctest.NORMALIZE_WHITESPACE}], |
|
68 | 'tests.test-url': [{'optionflags': doctest.NORMALIZE_WHITESPACE}], | |
69 | } |
|
69 | } | |
70 |
|
70 | |||
71 | doctest_indicator = '\n\\s*>>> ' |
|
71 | fileset = 'set:(**.py)' | |
72 | fileset = 'set:(**.py and grep("%s"))' % doctest_indicator |
|
72 | ||
|
73 | cwd = os.path.dirname(os.environ["TESTDIR"]) | |||
73 |
|
74 | |||
74 | files = subprocess.check_output( |
|
75 | files = subprocess.check_output( | |
75 |
"hg files --print0 |
|
76 | "hg files --print0 \"%s\"" % fileset, shell=True, cwd=cwd, | |
76 | shell=True, |
|
|||
77 | cwd=os.path.dirname(os.environ['TESTDIR']), |
|
|||
78 | ).split(b'\0') |
|
77 | ).split(b'\0') | |
79 |
|
78 | |||
|
79 | if sys.version_info[0] >= 3: | |||
|
80 | cwd = os.fsencode(cwd) | |||
|
81 | ||||
80 | mods_tested = set() |
|
82 | mods_tested = set() | |
81 | for f in files: |
|
83 | for f in files: | |
82 | if not f: |
|
84 | if not f: | |
83 | continue |
|
85 | continue | |
84 |
|
86 | |||
|
87 | with open(os.path.join(cwd, f), "rb") as fh: | |||
|
88 | if not re.search(br'\n\s*>>>', fh.read()): | |||
|
89 | continue | |||
|
90 | ||||
85 | if ispy3: |
|
91 | if ispy3: | |
86 | f = f.decode() |
|
92 | f = f.decode() | |
87 |
|
93 |
General Comments 0
You need to be logged in to leave comments.
Login now