Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading