Repository navigation
Conversation
809baf6 to
632e780
Compare
|
When env. var. On this branch, the tests run without fixtures on Travis / python 3.6, and the usual way in every other configuration. For no-fixture tests, I temporarily disabled units tests for When The current status for pytest (I'll update it as problems are resolved on master): 9 failed, 2415 passed. I fixed everything that requires just minor edits to tests. The rest requires merging some PR referenced from #3111. |
f9a7cfa to
60ba056
Compare
* Env. var. NO_BUILTINS_FIXTURES=1 triggers using regular version for tests * If NO_BUILTINS_FIXTURES=1, minor test error message differences are ignored * Travis under python 3.6 build will run tests without fixtures
aa46617 to
b070899
Compare
| [builtins fixtures/dict.pyi] | ||
|
|
||
| [case testNoReturnImportFromTyping] | ||
| from typing import NoReturn |
There was a problem hiding this comment.
This is not right. If it fails, then typeshed should be updated, this is why this test is called testNoReturnImportFromTyping.
There was a problem hiding this comment.
But python runtime would crash on that. Why would we want to allow it in mypy?
There was a problem hiding this comment.
Oh I'm on python 3.6.0 so didn't realize that haha
There was a problem hiding this comment.
BTW, you mean typing.NoReturn is in cpython master right? It's not yet in 3.6.1. I think it's fine for mypy to allow things that are valid on cpython master.
There was a problem hiding this comment.
It will be included in 3.6.2
| [case testTypeCheckNamedModule] | ||
| # cmd: mypy -m m.a | ||
| [file m/__init__.py] | ||
| None + 1 |
There was a problem hiding this comment.
Why do you replace None with object() everywhere? This does not seem right.
There was a problem hiding this comment.
I only replaced the cases where the intent is to check whether mypy gets to a given line. The test basically assumes that None + 1 will cause type error. But they don't fail because --strict-optional isn't the default. object() + 1 will fail under any conditions, so I thought I'd use it.
There was a problem hiding this comment.
IIRC, some tests are actually run with automatic addition of --strict-optional flag. Why this changes with your PR?
There was a problem hiding this comment.
It shouldn't change.
But apart from flags added to tests, and tests inside typeshed, and mypy mypy tests, I can't find tests that have automatic strict-optional. Are you sure it was done to the pytest tests?
There was a problem hiding this comment.
Are you sure it was done to the pytest tests?
I am not, but I assumed this, since the tests were passing before, i.e. were giving an error for None + 1.
There was a problem hiding this comment.
It was just because in the builtins fixture int.__radd__ isn't defined (only int.__add__). And the subtyping is only checked for the rhs, not for the lhs of these operators.
|
|
||
| x = foo() | ||
| x = 1 | ||
| x = x + 1 |
There was a problem hiding this comment.
What is the reason for this change? This looks strange.
|
The main purpose of this PR is to allow everyone to run no-fixtures tests locally by setting |
|
After you review, I was going to rebase this off the current master to make it less likely to cause weird merge conflicts. |
|
This PR has a lot of old stuff that would make merging it very messy. I'm closing this in favor of #3268. @ilevkivskyi I'm not just rebasing on master within this PR because you were reviewing it, and you'll lose the context if I do so. |
Based on #3111. I am using this PR to examine the impact of removing builtins fixtures (# of failing tests and performance impact).