]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-108303: Move more files to `Lib/test/test_module` (GH-111880) (#111891)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 9 Nov 2023 15:21:24 +0000 (16:21 +0100)
committerGitHub <noreply@github.com>
Thu, 9 Nov 2023 15:21:24 +0000 (15:21 +0000)
gh-108303: Move more files to `Lib/test/test_module` (GH-111880)
(cherry picked from commit 0c42f7304a2757fe0f78bc6c6fbb33225cd9da15)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Lib/test/test_module/__init__.py
Lib/test/test_module/final_a.py [moved from Lib/test/final_a.py with 79% similarity]
Lib/test/test_module/final_b.py [moved from Lib/test/final_b.py with 79% similarity]

index 2524e6c87cb459646f17477af66af8b4d40eada7..db2133a9e8d17bbd768f62c7bbdd9755e988de12 100644 (file)
@@ -266,7 +266,7 @@ a = A(destroyed)"""
 
     def test_module_finalization_at_shutdown(self):
         # Module globals and builtins should still be available during shutdown
-        rc, out, err = assert_python_ok("-c", "from test import final_a")
+        rc, out, err = assert_python_ok("-c", "from test.test_module import final_a")
         self.assertFalse(err)
         lines = out.splitlines()
         self.assertEqual(set(lines), {
similarity index 79%
rename from Lib/test/final_a.py
rename to Lib/test/test_module/final_a.py
index 390ee8895a8a9e8c34760be828a9dba1e4f0b975..a983f3111248e0d2ee04ada17a911e048f522f3c 100644 (file)
@@ -3,7 +3,7 @@ Fodder for module finalization tests in test_module.
 """
 
 import shutil
-import test.final_b
+import test.test_module.final_b
 
 x = 'a'
 
@@ -11,7 +11,7 @@ class C:
     def __del__(self):
         # Inspect module globals and builtins
         print("x =", x)
-        print("final_b.x =", test.final_b.x)
+        print("final_b.x =", test.test_module.final_b.x)
         print("shutil.rmtree =", getattr(shutil.rmtree, '__name__', None))
         print("len =", getattr(len, '__name__', None))
 
similarity index 79%
rename from Lib/test/final_b.py
rename to Lib/test/test_module/final_b.py
index 7228d82b880156fc59a67089f3618a21df2fda41..f3e8d5594904f24efd1d3f41afa91d206f166d03 100644 (file)
@@ -3,7 +3,7 @@ Fodder for module finalization tests in test_module.
 """
 
 import shutil
-import test.final_a
+import test.test_module.final_a
 
 x = 'b'
 
@@ -11,7 +11,7 @@ class C:
     def __del__(self):
         # Inspect module globals and builtins
         print("x =", x)
-        print("final_a.x =", test.final_a.x)
+        print("final_a.x =", test.test_module.final_a.x)
         print("shutil.rmtree =", getattr(shutil.rmtree, '__name__', None))
         print("len =", getattr(len, '__name__', None))