From 0c42f7304a2757fe0f78bc6c6fbb33225cd9da15 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 9 Nov 2023 17:42:34 +0300 Subject: gh-108303: Move more files to `Lib/test/test_module` (#111880) --- Lib/test/final_a.py | 19 ------------------- Lib/test/final_b.py | 19 ------------------- Lib/test/test_module/__init__.py | 2 +- Lib/test/test_module/final_a.py | 19 +++++++++++++++++++ Lib/test/test_module/final_b.py | 19 +++++++++++++++++++ 5 files changed, 39 insertions(+), 39 deletions(-) delete mode 100644 Lib/test/final_a.py delete mode 100644 Lib/test/final_b.py create mode 100644 Lib/test/test_module/final_a.py create mode 100644 Lib/test/test_module/final_b.py diff --git a/Lib/test/final_a.py b/Lib/test/final_a.py deleted file mode 100644 index 390ee88..0000000 --- a/Lib/test/final_a.py +++ /dev/null @@ -1,19 +0,0 @@ -""" -Fodder for module finalization tests in test_module. -""" - -import shutil -import test.final_b - -x = 'a' - -class C: - def __del__(self): - # Inspect module globals and builtins - print("x =", x) - print("final_b.x =", test.final_b.x) - print("shutil.rmtree =", getattr(shutil.rmtree, '__name__', None)) - print("len =", getattr(len, '__name__', None)) - -c = C() -_underscored = C() diff --git a/Lib/test/final_b.py b/Lib/test/final_b.py deleted file mode 100644 index 7228d82..0000000 --- a/Lib/test/final_b.py +++ /dev/null @@ -1,19 +0,0 @@ -""" -Fodder for module finalization tests in test_module. -""" - -import shutil -import test.final_a - -x = 'b' - -class C: - def __del__(self): - # Inspect module globals and builtins - print("x =", x) - print("final_a.x =", test.final_a.x) - print("shutil.rmtree =", getattr(shutil.rmtree, '__name__', None)) - print("len =", getattr(len, '__name__', None)) - -c = C() -_underscored = C() diff --git a/Lib/test/test_module/__init__.py b/Lib/test/test_module/__init__.py index 2524e6c..db2133a 100644 --- a/Lib/test/test_module/__init__.py +++ b/Lib/test/test_module/__init__.py @@ -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), { diff --git a/Lib/test/test_module/final_a.py b/Lib/test/test_module/final_a.py new file mode 100644 index 0000000..a983f31 --- /dev/null +++ b/Lib/test/test_module/final_a.py @@ -0,0 +1,19 @@ +""" +Fodder for module finalization tests in test_module. +""" + +import shutil +import test.test_module.final_b + +x = 'a' + +class C: + def __del__(self): + # Inspect module globals and builtins + print("x =", 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)) + +c = C() +_underscored = C() diff --git a/Lib/test/test_module/final_b.py b/Lib/test/test_module/final_b.py new file mode 100644 index 0000000..f3e8d55 --- /dev/null +++ b/Lib/test/test_module/final_b.py @@ -0,0 +1,19 @@ +""" +Fodder for module finalization tests in test_module. +""" + +import shutil +import test.test_module.final_a + +x = 'b' + +class C: + def __del__(self): + # Inspect module globals and builtins + print("x =", 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)) + +c = C() +_underscored = C() -- cgit v0.12