mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Stronger tests for combinatoric relationships.
This commit is contained in:
parent
2976aaa396
commit
f93f3032c6
2 changed files with 9 additions and 1 deletions
|
@ -844,6 +844,8 @@ class DocTestFinder:
|
|||
globs = globs.copy()
|
||||
if extraglobs is not None:
|
||||
globs.update(extraglobs)
|
||||
if '__name__' not in globs:
|
||||
globs['__name__'] = '__main__' # provide a default module name
|
||||
|
||||
# Recursively expore `obj`, extracting DocTests.
|
||||
tests = []
|
||||
|
@ -1937,6 +1939,8 @@ def testfile(filename, module_relative=True, name=None, package=None,
|
|||
globs = globs.copy()
|
||||
if extraglobs is not None:
|
||||
globs.update(extraglobs)
|
||||
if '__name__' not in globs:
|
||||
globs['__name__'] = '__main__'
|
||||
|
||||
if raise_on_error:
|
||||
runner = DebugRunner(verbose=verbose, optionflags=optionflags)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue