Skip to content

fails when running pytest --tap-stream -h #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cdleonard opened this issue Oct 26, 2021 · 2 comments · Fixed by #60
Closed

fails when running pytest --tap-stream -h #59

cdleonard opened this issue Oct 26, 2021 · 2 comments · Fixed by #60

Comments

@cdleonard
Copy link

I attempted to write a wrapper that always passes --tap-stream to the underlying pytest call and this appears to break -h

$ pytest --tap-stream -h
1..0
Traceback (most recent call last):
  File "/home/leonard/.local/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/usr/local/lib/python3.8/dist-packages/_pytest/config/__init__.py", line 185, in console_main
    code = main()
  File "/usr/local/lib/python3.8/dist-packages/_pytest/config/__init__.py", line 162, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/usr/local/lib/python3.8/dist-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.8/dist-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.8/dist-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/usr/local/lib/python3.8/dist-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/usr/local/lib/python3.8/dist-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/local/lib/python3.8/dist-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/local/lib/python3.8/dist-packages/_pytest/helpconfig.py", line 149, in pytest_cmdline_main
    showhelp(config)
  File "/usr/local/lib/python3.8/dist-packages/_pytest/helpconfig.py", line 159, in showhelp
    tw = reporter._tw
AttributeError: 'NoneType' object has no attribute '_tw'
@mblayman
Copy link
Member

I was able to replicate this locally. It's been quite a while since I updated this project so I've got work to do (like upgrading CI), but I'll try to get to this issue soon.

@cdleonard
Copy link
Author

Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants