Skip to content

Commit e3210d0

Browse files
authored
meta tests: fix flake (#15480)
Since tests are parallelized, the temporary test name must be unique.
1 parent 1e5caa0 commit e3210d0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

mypy/test/meta/test_parse_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import subprocess
66
import sys
77
import textwrap
8+
import uuid
89
from pathlib import Path
910

1011
from mypy.test.config import test_data_prefix
@@ -18,7 +19,7 @@ def _dedent(self, s: str) -> str:
1819
def _run_pytest(self, data_suite: str) -> str:
1920
p_test_data = Path(test_data_prefix)
2021
p_root = p_test_data.parent.parent
21-
p = p_test_data / "check-__fixture__.test"
22+
p = p_test_data / f"check-meta-{uuid.uuid4()}.test"
2223
assert not p.exists()
2324
try:
2425
p.write_text(data_suite)

mypy/test/meta/test_update_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import subprocess
88
import sys
99
import textwrap
10+
import uuid
1011
from pathlib import Path
1112

1213
from mypy.test.config import test_data_prefix
@@ -21,7 +22,7 @@ def _run_pytest_update_data(self, data_suite: str, *, max_attempts: int) -> str:
2122
"""
2223
p_test_data = Path(test_data_prefix)
2324
p_root = p_test_data.parent.parent
24-
p = p_test_data / "check-__fixture__.test"
25+
p = p_test_data / f"check-meta-{uuid.uuid4()}.test"
2526
assert not p.exists()
2627
try:
2728
p.write_text(textwrap.dedent(data_suite).lstrip())

0 commit comments

Comments
 (0)