Skip to content

Fix a flaky test by cleaning a polluted state.#4

Open
sturmianseq wants to merge 1 commit intokivio:masterfrom
sturmianseq:sturmianseq-patch-flaky
Open

Fix a flaky test by cleaning a polluted state.#4
sturmianseq wants to merge 1 commit intokivio:masterfrom
sturmianseq:sturmianseq-patch-flaky

Conversation

@sturmianseq
Copy link
Copy Markdown

What is the purpose of the change

This PR is to fix a flaky test tests/test_propagation_logger.py::test_forcing_level_by_dict, which can fail after running tests/test_propagation_logger.py::test_forcing_level_by_level_name, but passes when run in isolation.

Reproduce the test failure

Run the following command:

python -m pytest tests/test_propagation_logger.py::test_forcing_level_by_level_name tests/test_propagation_logger.py::test_forcing_level_by_dict

Expected result

tests/test_propagation_logger.py::test_forcing_level_by_dict should pass after running tests/test_propagation_logger.py::test_forcing_level_by_level_name.

Actual result

E           Failed: DID NOT RAISE <class 'IndexError'>

tests/test_propagation_logger.py:116: Failed

Why it fails

propagation_logger is polluted after running tests/test_propagation_logger.py::test_forcing_level_by_level_name.

Fix

Reset propagation_logger at the beginning of tests/test_propagation_logger.py::test_forcing_level_by_dict

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 this pull request may close these issues.

1 participant