Skip to content

Commit

Permalink
Ensure pytest captures stdout/stderr logs when running tests
Browse files Browse the repository at this point in the history
As long as the test passes the logs shouldn't be an issue, by default
pytest will still show logs from tests that fail so this should be ok.

This commit also removes the warning filters as there are some real
warnings being skipped and they should be taken more seriously as they
might lead to real issues.
  • Loading branch information
Adrian Torres committed Jan 13, 2023
1 parent 6c5b37e commit 9d03138
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[pytest]
addopts = --ignore src --cov-config=.coveragerc --cov osidb --cov apps --cov collectors --cov-append --cov-report html --cov-report xml:coverage.xml --cov-report term --strict-config --strict-markers --rootdir . --reuse-db -ra -s
addopts = --ignore src --cov-config=.coveragerc --cov osidb --cov apps --cov collectors --cov-append --cov-report html --cov-report xml:coverage.xml --cov-report term --strict-config --strict-markers --rootdir . --reuse-db -ra
# Use -rA (-rpP) to see output even for (only for) passing tests: https://docs.pytest.org/en/latest/how-to/output.html
# Disabled by default because it spams the console and makes it hard to find output for failing tests

Expand All @@ -8,12 +8,3 @@ markers =
unit: marks a unit test.
integration: marks a test that requires access to running environment.
enable_signals: enables django signals to run.
filterwarnings =
ignore::UserWarning
ignore::DeprecationWarning
ignore::PendingDeprecationWarning

log_cli = 1
log_cli_level = WARNING
log_cli_format = %(asctime)s %(levelname)s %(message)s
log_cli_date_format = %H:%M:%S

0 comments on commit 9d03138

Please sign in to comment.