diff options
author | Victor Stinner <vstinner@python.org> | 2023-09-21 18:59:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-21 18:59:11 (GMT) |
commit | ca8da713d5078318efc72059cba15b50d0ea5ccb (patch) | |
tree | 32ecf88a0d8c429aa00a3d174f1b6f6fad2dc49a | |
parent | e59ee6c59e8894f96907240c0b4a17a97178780d (diff) | |
download | cpython-ca8da713d5078318efc72059cba15b50d0ea5ccb.zip cpython-ca8da713d5078318efc72059cba15b50d0ea5ccb.tar.gz cpython-ca8da713d5078318efc72059cba15b50d0ea5ccb.tar.bz2 |
[3.11] gh-108303: Create Lib/test/test_dataclasses/ directory (#108978) (#109675)
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 14d6e197cc56e5256d501839a4e66e3864ab15f0)
-rw-r--r-- | Lib/test/.ruff.toml | 2 | ||||
-rw-r--r-- | Lib/test/test_dataclasses/__init__.py (renamed from Lib/test/test_dataclasses.py) | 10 | ||||
-rw-r--r-- | Lib/test/test_dataclasses/dataclass_module_1.py (renamed from Lib/test/dataclass_module_1.py) | 0 | ||||
-rw-r--r-- | Lib/test/test_dataclasses/dataclass_module_1_str.py (renamed from Lib/test/dataclass_module_1_str.py) | 0 | ||||
-rw-r--r-- | Lib/test/test_dataclasses/dataclass_module_2.py (renamed from Lib/test/dataclass_module_2.py) | 0 | ||||
-rw-r--r-- | Lib/test/test_dataclasses/dataclass_module_2_str.py (renamed from Lib/test/dataclass_module_2_str.py) | 0 | ||||
-rw-r--r-- | Lib/test/test_dataclasses/dataclass_textanno.py (renamed from Lib/test/dataclass_textanno.py) | 0 | ||||
-rw-r--r-- | Makefile.pre.in | 1 |
8 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/.ruff.toml b/Lib/test/.ruff.toml index 24f3f8c..08bd5c8 100644 --- a/Lib/test/.ruff.toml +++ b/Lib/test/.ruff.toml @@ -13,7 +13,7 @@ extend-exclude = [ "test_fstring.py", # TODO Fix: F811 Redefinition of unused name "test_buffer.py", - "test_dataclasses.py", + "test_dataclasses/__init__.py", "test_descr.py", "test_enum.py", "test_functools.py", diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses/__init__.py index 4714d0b..682f351 100644 --- a/Lib/test/test_dataclasses.py +++ b/Lib/test/test_dataclasses/__init__.py @@ -3568,10 +3568,10 @@ class TestStringAnnotations(unittest.TestCase): self.assertEqual(C(10).x, 10) def test_classvar_module_level_import(self): - from test import dataclass_module_1 - from test import dataclass_module_1_str - from test import dataclass_module_2 - from test import dataclass_module_2_str + from test.test_dataclasses import dataclass_module_1 + from test.test_dataclasses import dataclass_module_1_str + from test.test_dataclasses import dataclass_module_2 + from test.test_dataclasses import dataclass_module_2_str for m in (dataclass_module_1, dataclass_module_1_str, dataclass_module_2, dataclass_module_2_str, @@ -3609,7 +3609,7 @@ class TestStringAnnotations(unittest.TestCase): self.assertNotIn('not_iv4', c.__dict__) def test_text_annotations(self): - from test import dataclass_textanno + from test.test_dataclasses import dataclass_textanno self.assertEqual( get_type_hints(dataclass_textanno.Bar), diff --git a/Lib/test/dataclass_module_1.py b/Lib/test/test_dataclasses/dataclass_module_1.py index 87a33f8..87a33f8 100644 --- a/Lib/test/dataclass_module_1.py +++ b/Lib/test/test_dataclasses/dataclass_module_1.py diff --git a/Lib/test/dataclass_module_1_str.py b/Lib/test/test_dataclasses/dataclass_module_1_str.py index 6de490b..6de490b 100644 --- a/Lib/test/dataclass_module_1_str.py +++ b/Lib/test/test_dataclasses/dataclass_module_1_str.py diff --git a/Lib/test/dataclass_module_2.py b/Lib/test/test_dataclasses/dataclass_module_2.py index 68fb733..68fb733 100644 --- a/Lib/test/dataclass_module_2.py +++ b/Lib/test/test_dataclasses/dataclass_module_2.py diff --git a/Lib/test/dataclass_module_2_str.py b/Lib/test/test_dataclasses/dataclass_module_2_str.py index b363d17..b363d17 100644 --- a/Lib/test/dataclass_module_2_str.py +++ b/Lib/test/test_dataclasses/dataclass_module_2_str.py diff --git a/Lib/test/dataclass_textanno.py b/Lib/test/test_dataclasses/dataclass_textanno.py index 3eb6c94..3eb6c94 100644 --- a/Lib/test/dataclass_textanno.py +++ b/Lib/test/test_dataclasses/dataclass_textanno.py diff --git a/Makefile.pre.in b/Makefile.pre.in index 99b1be2..885089b 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1962,6 +1962,7 @@ TESTSUBDIRS= ctypes/test \ test/test_asyncio \ test/test_capi \ test/test_cppext \ + test/test_dataclasses \ test/test_email \ test/test_email/data \ test/test_import \ |