From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:11:03 +0000 (-0700) Subject: [3.12] gh-108303: Create Lib/test/test_dataclasses/ directory (GH-108978) (#109674) X-Git-Tag: v3.12.1~447 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9bceb8a79b73b3a0791a6621a40469c84869460a;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-108303: Create Lib/test/test_dataclasses/ directory (GH-108978) (#109674) * gh-108303: Create Lib/test/test_dataclasses/ directory (GH-108978) Move test_dataclasses.py and its "dataclass_*.py" modules into the new Lib/test/test_dataclasses/ subdirectory. (cherry picked from commit 14d6e197cc56e5256d501839a4e66e3864ab15f0) Co-authored-by: Victor Stinner * Fix Lint job: update Lib/test/.ruff.toml --------- Co-authored-by: Victor Stinner --- diff --git a/Lib/test/.ruff.toml b/Lib/test/.ruff.toml index 3bdd472c0acd..2d9c9eeae6c0 100644 --- a/Lib/test/.ruff.toml +++ b/Lib/test/.ruff.toml @@ -22,7 +22,7 @@ extend-exclude = [ "test_capi/test_unicode.py", "test_ctypes/test_arrays.py", "test_ctypes/test_functions.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 similarity index 99% rename from Lib/test/test_dataclasses.py rename to Lib/test/test_dataclasses/__init__.py index 6669f1c57e2e..2b09db03d4d2 100644 --- a/Lib/test/test_dataclasses.py +++ b/Lib/test/test_dataclasses/__init__.py @@ -3684,10 +3684,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, @@ -3725,7 +3725,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 similarity index 100% rename from Lib/test/dataclass_module_1.py rename to 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 similarity index 100% rename from Lib/test/dataclass_module_1_str.py rename to 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 similarity index 100% rename from Lib/test/dataclass_module_2.py rename to 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 similarity index 100% rename from Lib/test/dataclass_module_2_str.py rename to 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 similarity index 100% rename from Lib/test/dataclass_textanno.py rename to Lib/test/test_dataclasses/dataclass_textanno.py diff --git a/Makefile.pre.in b/Makefile.pre.in index 09ceccda1dcd..cf054c19de6c 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -2134,6 +2134,7 @@ TESTSUBDIRS= idlelib/idle_test \ test/test_capi \ test/test_cppext \ test/test_ctypes \ + test/test_dataclasses \ test/test_email \ test/test_email/data \ test/test_import \