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
logging level and output capture sensitive to environment and confusing #10283
Comments
This comment was marked as outdated.
This comment was marked as outdated.
I can prevent capturing in the CI runs with |
For now I have switched to a more defensive set of options that won't print above WARNING level by default:
I still find the interaction of these different CLI args/options around output and logging to be confusing. Some of them seem to affect both "live logs" and "captured logs" modes in unintuitive ways. I'm not sure that this is a very useful report so feel free to close it. |
After restarting/rebooting various environments the behaviouor has changed once again. I now have live logs but some of them are formatted incorrectly, and without the |
Final comment: I note that
I also observe similar behaviour running pytest on itself, which is that the I think there are probably multiple issues here, which may deserve individual trackers:
One last thing, from the cli help:
I don't understand: |
I'm seeing exactly these three failures any time I don't redirect stdout somehow.. In Python 3.9 on Linux:
Since this is my first time trying to build from source, I'm trying to control my environments pretty tightly. My primary reproducible environment is on a fresh AWS EC2 instance from the I'll post some scripts to reproduce in my next comment. |
I'd imagine the virtualenv stuff is redundant because already managed by tox; is that right? |
I am experiencing sporadic and unusual behaviour with pytest, which is related to a few issues already posted here but I can't be sure that it's the same thing.
I am developing a package which uses pytest. I run tests in three environments:
venv
venv
ubuntu-latest
and latest Python3.10
Right now I'm facing an issue which appeared sporadically but now seems to be reproducible on Arch. Running pytest I hit the infamousI think this was caused by pytest trying to run tests from a git-worktree subdirectory, so this is a different issue to what will be discussed in the rest of this thread.option names already defined
error, and no tests are run.I also have a second issue, which appears only in the CI environment but not on my local Ubuntu. Pytest is not respecting my logging options, and always captures verbose log messages on console.
Environment
Pip list of my local environments all look like:
where
pydrex
is the editable dev package.I don't have any pytest config files except a
conftest.py
with some fixtures, a custom CLI arg definition and some logging defaults. The relevant section is:I also set up a logger with the possibility to have multiple handlers at different verbosity levels:
The behaviour I expect based on the above setup is:
--outdir
can be used via the fixture--log-cli-level
Instead I observe:
On Arch, test collection failure due toseparate issue caused by git-worktreeparser_addoption
The text was updated successfully, but these errors were encountered: