Skip to content

Commit 8e61b79

Browse files
committed
Move all tests into one because xdist
xdist isn't flexible enough to run a given set of tests in one process If these tests are split into multiple processes, they will take a lot longer since each will wait for locks to die out at the end.
1 parent 2d369c0 commit 8e61b79

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

mypy/test/testutil.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ReliableReplace(TestCase):
3838
threads = [] # type: List[Thread]
3939

4040
@classmethod
41-
def tearDownClass(cls):
41+
def tearDownClass(cls) -> None:
4242
for t in cls.threads:
4343
t.join()
4444

@@ -62,19 +62,17 @@ def replace_ok(self, src_lock_duration: float, dest_lock_duration: float,
6262
util._replace(src, dest, timeout=timeout)
6363
self.assertEqual(open(dest).read(), src, 'replace failed')
6464

65-
def test_normal(self) -> None:
65+
def test_everything(self) -> None:
66+
# normal use, no locks
6667
self.replace_ok(0, 0, self.timeout)
67-
68-
def test_problem_exists(self) -> None:
68+
# make sure the problem is real
6969
src, dest = self.prepare_src_dest(self.short_lock, 0)
7070
with self.assertRaises(PermissionError):
7171
os.replace(src, dest)
72-
73-
def test_short_lock(self) -> None:
72+
# short lock
7473
self.replace_ok(self.short_lock, 0, self.timeout)
7574
self.replace_ok(0, self.short_lock, self.timeout)
76-
77-
def test_long_lock(self) -> None:
75+
# long lock
7876
with self.assertRaises(PermissionError):
7977
self.replace_ok(self.long_lock, 0, self.timeout)
8078
with self.assertRaises(PermissionError):

0 commit comments

Comments
 (0)