-
Notifications
You must be signed in to change notification settings - Fork 112
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
Strange behaviour with dataclass mutation #328
Comments
My assumption is it doesn't detect test failure, due to the fact that the tests do not run and in fact fail to be collected (due to the invalid use of a now non dataclass object with no init)
|
From local testing I believe this would fix the issue (status code 2 is returned by pytest when test collection fails, despite the documation claiming it occurs when a user cancels the test run),
|
Ooh. Good catch! I had a recent similarly weird surviving mutant that clearly fails tests that I didn't have time to investigate. I bet it's this thing! |
I just released mutmut 3, which is a big rewrite. I believe this issue no longer applies anymore. Feel free to reopen it if it still exists. |
I have a dataclass that is mutated (removing the dataclass decorator) which fails tests if applied, but does not get picked up as a handled mutation. I have cleared the cache, and checked tests with the mutation applied (confirming they do in fact fail)
I've replicated a minimal example that I think points to where the problem originates, but not why it originates.
Given the following code and tests, it correctly detects the mutation and it is killed.
code.py
tests/test.py
But if the dataclass is used in the declaring module, then the mutation is detected as still alive.
code.py
tests/test.py
The text was updated successfully, but these errors were encountered: