-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Tests behave differently without builtins fixtures #3111
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
Comments
Edit: output updated now that I disabled And this is the output of
|
Thanks for looking into this! Would you like to create issues just for the crashes, as we should definitely investigate them? |
I could immediately guess the cause for the crash in |
@JukkaL I did; luckily, only one real crash (well 2 tests crash for the same reason; and 4 tests crash for the reason @ilevkivskyi said) @ilevkivskyi Actually, I just didn't notice that |
So there are 4 reasons tests may fail without builtins fixture:
My suggestions for each type of test:
|
I forgot the rest of my proposal: To make sure that without custom builtins stubs the tests would actually fail in cases 1), 3), 4), and pass in case 2) , we can:
I can modify my #3112 to do that, if this approach seems desirable. Alternatively, if we really want Travis CI to finish fast, we can create a new branch |
Closing due to lack of activity. |
I was somewhat concerned that test builtins fixtures might not perfectly represent the production version of mypy, so I ran the tests without the fixtures.
The good news is that, as expected, fixtures make tests at least twice faster (pytest alone takes 212 sec without the fixtures, and 12 sec with).
The bad news is that 60 out of 2309 tests failed. Many of the failures were trivial (a slight change in the error message since the test was written, or not defining a type variables because it's already defined in the fixture). But a few were more serious.
For example this code (from check-class-namedtuple.test: testNewNamedTupleJoinTuple), instead of reporting the two revealed types, crashed mypy (under python 3.6):
This code (from check-namedtuple.test: testNamedTupleMake) didn't report the second expected error message:
Not sure what the best solution is. Maybe it's worth having a daily run of all tests without fixtures using some special commit.
In any case, I made a branch that allows to easily run tests without fixtures because I couldn't find a command line parameter that would do it. I'll push a PR for it, although it's probably more appropriate for testing and discussion, not for merging.
The text was updated successfully, but these errors were encountered: