Skip to content

Commit f9de4c9

Browse files
committed
Split tests according to their purpose
1 parent f05647c commit f9de4c9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mypy/test/testutil.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,22 @@ def replace_ok(self, src_lock_duration: float, dest_lock_duration: float,
7272
util._replace(src, dest, timeout=timeout)
7373
self.assertEqual(open(dest).read(), src, 'replace failed')
7474

75-
def test_everything(self) -> None:
75+
def test_no_locks(self) -> None:
7676
# No files locked.
7777
self.replace_ok(0, 0, self.timeout)
78+
79+
def test_original_problem(self) -> None:
7880
# Make sure we can reproduce the issue with our setup.
7981
src, dest = self.prepare_src_dest(self.short_lock, 0)
8082
with self.assertRaises(PermissionError):
8183
os.replace(src, dest)
84+
85+
def test_short_locks(self) -> None:
8286
# Lock files for a time short enough that util.replace won't timeout.
8387
self.replace_ok(self.short_lock, 0, self.timeout)
8488
self.replace_ok(0, self.short_lock, self.timeout)
89+
90+
def test_long_locks(self) -> None:
8591
# Lock files for a time long enough that util.replace times out.
8692
with self.assertRaises(PermissionError):
8793
self.replace_ok(self.long_lock, 0, self.timeout)

0 commit comments

Comments
 (0)