bpo-38614: Use support timeout constants (GH-17572)

This commit is contained in:
Victor Stinner 2019-12-11 22:17:04 +01:00 committed by GitHub
parent 0d63bacefd
commit 7772b1af5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 67 additions and 36 deletions

View file

@ -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()