Skip to content

Commit 77cb5e8

Browse files
committed
gh-108303: Create Lib/test/test_dataclasses/ directory (#108978)
Move test_dataclasses.py and its "dataclass_*.py" modules into the new Lib/test/test_dataclasses/ subdirectory. Backport to 3.11: update Lib/test/.ruff.toml. (cherry picked from commit 14d6e19)
1 parent 3ba4dfe commit 77cb5e8

8 files changed

+7
-6
lines changed

Lib/test/.ruff.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extend-exclude = [
1313
"test_fstring.py",
1414
# TODO Fix: F811 Redefinition of unused name
1515
"test_buffer.py",
16-
"test_dataclasses.py",
16+
"test_dataclasses/__init__.py",
1717
"test_descr.py",
1818
"test_enum.py",
1919
"test_functools.py",

Lib/test/test_dataclasses.py renamed to Lib/test/test_dataclasses/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -3568,10 +3568,10 @@ class C:
35683568
self.assertEqual(C(10).x, 10)
35693569

35703570
def test_classvar_module_level_import(self):
3571-
from test import dataclass_module_1
3572-
from test import dataclass_module_1_str
3573-
from test import dataclass_module_2
3574-
from test import dataclass_module_2_str
3571+
from test.test_dataclasses import dataclass_module_1
3572+
from test.test_dataclasses import dataclass_module_1_str
3573+
from test.test_dataclasses import dataclass_module_2
3574+
from test.test_dataclasses import dataclass_module_2_str
35753575

35763576
for m in (dataclass_module_1, dataclass_module_1_str,
35773577
dataclass_module_2, dataclass_module_2_str,
@@ -3609,7 +3609,7 @@ def test_classvar_module_level_import(self):
36093609
self.assertNotIn('not_iv4', c.__dict__)
36103610

36113611
def test_text_annotations(self):
3612-
from test import dataclass_textanno
3612+
from test.test_dataclasses import dataclass_textanno
36133613

36143614
self.assertEqual(
36153615
get_type_hints(dataclass_textanno.Bar),

Makefile.pre.in

+1
Original file line numberDiff line numberDiff line change
@@ -1962,6 +1962,7 @@ TESTSUBDIRS= ctypes/test \
19621962
test/test_asyncio \
19631963
test/test_capi \
19641964
test/test_cppext \
1965+
test/test_dataclasses \
19651966
test/test_email \
19661967
test/test_email/data \
19671968
test/test_import \

0 commit comments

Comments
 (0)