-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix a flaky test by cleaning a polluted state. #42
Fix a flaky test by cleaning a polluted state. #42
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out!
Just to make sure we're completely clear of the issue, let's use a pytest.fixture
(and remove all manual *.clear()
calls).
Something like this should work:
@pytest.fixture(autouse=True)
def clear_assoccomm():
commutative.index.clear()
commutative.facts.clear()
associative.index.clear()
associative.facts.clear()
yield
Do you mind rebasing with a change to that effect?
e75e4a0
to
62acbf9
Compare
Hi @brandonwillard, I changed the patch, please review the code changes, thank you! |
62acbf9
to
b4580aa
Compare
There were some To avoid |
Also, I noticed that the commit doesn't reference your @sturmianseq account. If you want to change that, you can pull and then modify/rebase the commit. If you don't want to change it, tell me and I'll merge this. |
b4580aa
to
d10bbee
Compare
Thanks for the reminder! I changed the author, please merge it. |
What is the purpose of the change
This PR is to fix a flaky test
tests/test_assoccomm.py::test_eq_assoccomm
, which can fail after runningtests/test_assoccomm.py::test_assoccomm_objects
, but passes when it is run in isolation.Reproduce the test failure
Run the following command:
Expected Result
tests/test_assoccomm.py::test_eq_assoccomm
should pass after runningtests/test_assoccomm.py::test_assoccomm_objects
.Actual Result
Why it fails
facts
is not reset after runningtests/test_assoccomm.py::test_assoccomm_objects
withbool
remaining.Fix
Clear
associative.facts
beforetests/test_assoccomm.py::test_eq_assoccomm
.