8000 gh-108303: Remove the non-test `Lib/test/reperf.py` (GH-114356) · python/cpython@d7e8339 · GitHub
[go: up one dir, main page]

Skip to content

Commit d7e8339

Browse files
authored
gh-108303: Remove the non-test Lib/test/reperf.py (GH-114356)
1 parent 403f3dd commit d7e8339

File tree

3 files changed

+15
-28
lines changed

3 files changed

+15
-28
lines changed

Lib/test/_test_embed_structseq.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ def test_sys_funcs(self):
4848

4949

5050
try:
51-
unittest.main()
51+
unittest.main(
52+
module=(
53+
'__main__'
54+
if __name__ == '__main__'
55+
# Avoiding a circular import:
56+
else sys.modules['test._test_embed_structseq']
57+
)
58+
)
5259
except SystemExit as exc:
5360
if exc.args[0] != 0:
5461
raise

Lib/test/reperf.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

Lib/test/test_embed.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,7 +1971,11 @@ def test_no_memleak(self):
19711971
@unittest.skipUnless(support.Py_DEBUG,
19721972
'-X presite requires a Python debug build')
19731973
def test_presite(self):
1974-
cmd = [sys.executable, "-I", "-X", "presite=test.reperf", "-c", "print('cmd')"]
1974+
cmd = [
1975+
sys.executable,
1976+
"-I", "-X", "presite=test._test_embed_structseq",
1977+
"-c", "print('unique-python-message')",
1978+
]
19751979
proc = subprocess.run(
19761980
cmd,
19771981
stdout=subprocess.PIPE,
@@ -1980,9 +1984,8 @@ def test_presite(self):
19801984
)
19811985
self.assertEqual(proc.returncode, 0)
19821986
out = proc.stdout.strip()
1983-
self.assertIn("10 times sub", out)
1984-
self.assertIn("CPU seconds", out)
1985-
self.assertIn("cmd", out)
1987+
self.assertIn("Tests passed", out)
1988+
self.assertIn("unique-python-message", out)
19861989

19871990

19881991
class StdPrinterTests(EmbeddingTestsMixin, unittest.TestCase):

0 commit comments

Comments
 (0)
0