Commit 45a5cf3
authored
tests: Automatically run from source-tree root; and use default temp dir (#3426)
Several bits of our test runner system assume that the current working
directory when tests are run is the root of the mypy source tree. This is a
fine constraint to require, but the way we fail if that constraint is
broken is an error in each test case's setup, which pytest presents as
one of those massive stack traces it specializes in. See #3412.
These dependencies include the way we find a temporary directory to use,
and something to do with some imports. For the tempdir, just use `tempfile`
in the usual default way -- as a bonus, we no longer need to stick temporary
files under the source tree.
The import issues seem like bugs, but rather than chase down that kind of bug
in the test harness, just take care of the working directory automatically.1 parent 71efcdb commit 45a5cf3
2 files changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
| |||
0 commit comments