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

pytest: Add support for pytest-8.2 on Python3.11 (color, verbose) #113

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[pytest]
# By default, show reports for failed tests:
addopts=-rF
# By default, show reports for failed tests, and show the summary: -rF
# By default, also be verbose (needed for self-tests with pytest-8) -vv
# By default, also show the local variables in the traceback: --showlocals
addopts=-rF -vv --showlocals

# imp is only used in a unit test, will be updated to python3 later:
filterwarnings=ignore:the imp module is deprecated
# Enable live logging of the python log output, starting with log level INFO by default:
Expand Down
7 changes: 6 additions & 1 deletion tests/unit/test_filter_xapi_clusterd_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,13 @@ def test_assertion_on_unexpected_token(isolated_bugtool):
# -> Act and assert: Check that the assertion function fails on the unexpected output
# The assertion function should assert on the differing authkey value and the
# diff with the wrongly expected string should be in the assertion error message
#
# pytest-8 adds very fine-grained coloring of the assertion error message
# which makes it harder to match the diff string in the assertion error message.
# Apparently, we cannot disable the coloring for a single assertion, so we can
# only check for the the unexpected token in the assertion:

diff = "{'token': 'REMOVED'} != {'token': 'unexpected token value'}"
diff = "'token': 'unexpected token value'"
check_assert_on_unexpected_differences_in_output(isolated_bugtool, expected, diff)


Expand Down
Loading