mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
bpo-38614: Use support timeout constants (GH-17572)
This commit is contained in:
parent
0d63bacefd
commit
7772b1af5e
5 changed files with 67 additions and 36 deletions
|
@ -1303,10 +1303,14 @@ class AuditingTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
self.run_embedded_interpreter("test_audit_subinterpreter")
|
||||
|
||||
def test_audit_run_command(self):
|
||||
self.run_embedded_interpreter("test_audit_run_command", timeout=3, returncode=1)
|
||||
self.run_embedded_interpreter("test_audit_run_command",
|
||||
timeout=support.SHORT_TIMEOUT,
|
||||
returncode=1)
|
||||
|
||||
def test_audit_run_file(self):
|
||||
self.run_embedded_interpreter("test_audit_run_file", timeout=3, returncode=1)
|
||||
self.run_embedded_interpreter("test_audit_run_file",
|
||||
timeout=support.SHORT_TIMEOUT,
|
||||
returncode=1)
|
||||
|
||||
def test_audit_run_interactivehook(self):
|
||||
startup = os.path.join(self.oldcwd, support.TESTFN) + ".py"
|
||||
|
@ -1315,7 +1319,8 @@ class AuditingTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
print("sys.__interactivehook__ = lambda: None", file=f)
|
||||
try:
|
||||
env = {**remove_python_envvars(), "PYTHONSTARTUP": startup}
|
||||
self.run_embedded_interpreter("test_audit_run_interactivehook", timeout=5,
|
||||
self.run_embedded_interpreter("test_audit_run_interactivehook",
|
||||
timeout=support.SHORT_TIMEOUT,
|
||||
returncode=10, env=env)
|
||||
finally:
|
||||
os.unlink(startup)
|
||||
|
@ -1326,13 +1331,16 @@ class AuditingTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
print("pass", file=f)
|
||||
try:
|
||||
env = {**remove_python_envvars(), "PYTHONSTARTUP": startup}
|
||||
self.run_embedded_interpreter("test_audit_run_startup", timeout=5,
|
||||
self.run_embedded_interpreter("test_audit_run_startup",
|
||||
timeout=support.SHORT_TIMEOUT,
|
||||
returncode=10, env=env)
|
||||
finally:
|
||||
os.unlink(startup)
|
||||
|
||||
def test_audit_run_stdin(self):
|
||||
self.run_embedded_interpreter("test_audit_run_stdin", timeout=3, returncode=1)
|
||||
self.run_embedded_interpreter("test_audit_run_stdin",
|
||||
timeout=support.SHORT_TIMEOUT,
|
||||
returncode=1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue