Skip to content
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

Revamp code dealing with _tui_terminal_out #66

Closed
jeffwright13 opened this issue Sep 5, 2022 · 2 comments
Closed

Revamp code dealing with _tui_terminal_out #66

jeffwright13 opened this issue Sep 5, 2022 · 2 comments
Assignees

Comments

@jeffwright13
Copy link
Owner

There is a global (_tui_terminal_out) that is used to gather ansi-encoded info and send it to file. However, if pytest is invoked without --tui using only the --version flag, an error occurs:

~/coding/pytest-tui on  main! ⌚ 22:58:19
$  cd /Users/jwr003/coding/pytest-tui ; /usr/bin/env /Users/jwr003/coding/pytest-tui/venv/bin/python /Users/jwr003/.vscode/extensions/ms-python.python-2022.
14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 61620 -- /Users/jwr003/coding/pytest-tui/venv/bin/pytest --version 
pytest 7.2.0.dev264+g6ad32a9c5
sys:1: ResourceWarning: unclosed file <_io.BufferedRandom name=4>

We need that global because some processing code (e.g. pytest_runtest_logstart) is required that does not give access to the Pytest Config object.

However, it may be that the global doesn't have to be instantiated (only declared) in the global scope, which would simplify the use of this variable. As it is now we have a bunch of independent code all closing that tempfile out so that the pytest session doesn't end without it being closed.

@jeffwright13 jeffwright13 self-assigned this Sep 5, 2022
@jeffwright13
Copy link
Owner Author

See issue #67

@jeffwright13
Copy link
Owner Author

Took a bit of doing but fixed in 1.4.2.

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

No branches or pull requests

1 participant