Skip to content

Commit

Permalink
More debug outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Jan 30, 2024
1 parent faf4769 commit e3279e8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/xdoctest/utils/util_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,27 @@ def __init__(self, module_text, modname=None):
with open(self.modpath, 'w') as file:
file.write(module_text)

def print_contents(self):
"""
For debugging on windows
"""
import pathlib
print(f'--- <TempModule {self!r}> ---')
print(f'self.modname={self.modname!r}')
print(f'self.dpath={self.dpath!r}')
print(f'self.modpath={self.modpath!r}')
dpath = pathlib.Path(self.dpath)
print(f'dpath={dpath}')
dpath_exists = dpath.exists()
print(f'dpath_exists={dpath_exists!r}')
modpath = pathlib.Path(self.modpath)
print(f'modpath={modpath!r}')
modpath_exists = modpath.exists()
print(f'modpath_exists={modpath_exists!r}')
modpath_contents = modpath.read_text()
print(f'modpath_contents={modpath_contents!r}')
print(f'--- </TempModule {self!r}> ---')


def _run_case(source, style='auto'):
"""
Expand Down
1 change: 1 addition & 0 deletions tests/test_pytest_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def module_func1():
"""
''')
temp_module = util_misc.TempModule(module_text, modname='imperr_test_mod')
temp_module.print_contents()
command = sys.executable + ' -m pytest -v -s --xdoctest-verbose=3 --xdoctest-supress-import-errors --xdoctest ' + temp_module.dpath
print('-- PRINT COMMAND 1:')
print(command)
Expand Down

0 comments on commit e3279e8

Please sign in to comment.