Skip to content

Commit

Permalink
gh-108303: Remove the non-test Lib/test/reperf.py (GH-114356)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Sep 13, 2024
1 parent 403f3dd commit d7e8339
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
9 changes: 8 additions & 1 deletion Lib/test/_test_embed_structseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ def test_sys_funcs(self):


try:
unittest.main()
unittest.main(
module=(
'__main__'
if __name__ == '__main__'
# Avoiding a circular import:
else sys.modules['test._test_embed_structseq']
)
)
except SystemExit as exc:
if exc.args[0] != 0:
raise
Expand Down
23 changes: 0 additions & 23 deletions Lib/test/reperf.py

This file was deleted.

11 changes: 7 additions & 4 deletions Lib/test/test_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,11 @@ def test_no_memleak(self):
@unittest.skipUnless(support.Py_DEBUG,
'-X presite requires a Python debug build')
def test_presite(self):
cmd = [sys.executable, "-I", "-X", "presite=test.reperf", "-c", "print('cmd')"]
cmd = [
sys.executable,
"-I", "-X", "presite=test._test_embed_structseq",
"-c", "print('unique-python-message')",
]
proc = subprocess.run(
cmd,
stdout=subprocess.PIPE,
Expand All @@ -1980,9 +1984,8 @@ def test_presite(self):
)
self.assertEqual(proc.returncode, 0)
out = proc.stdout.strip()
self.assertIn("10 times sub", out)
self.assertIn("CPU seconds", out)
self.assertIn("cmd", out)
self.assertIn("Tests passed", out)
self.assertIn("unique-python-message", out)


class StdPrinterTests(EmbeddingTestsMixin, unittest.TestCase):
Expand Down

0 comments on commit d7e8339

Please sign in to comment.