##// END OF EJS Templates
Tests: Allow setting a custom timeout scale...
Miro Hrončok -
Show More
@@ -14,6 +14,7
14 14 import os
15 15 import sys
16 16 from IPython.testing.decorators import skip_win32
17 from IPython.testing import IPYTHON_TESTING_TIMEOUT_SCALE
17 18
18 19 #-----------------------------------------------------------------------------
19 20 # Tests
@@ -31,11 +32,11 def test_debug_magic_passes_through_generators():
31 32 env = os.environ.copy()
32 33 child = pexpect.spawn(sys.executable, ['-m', 'IPython', '--colors=nocolor', '--simple-prompt'],
33 34 env=env)
34 child.timeout = 15
35 child.timeout = 15 * IPYTHON_TESTING_TIMEOUT_SCALE
35 36
36 37 child.expect(in_prompt)
37 38
38 child.timeout = 2
39 child.timeout = 2 * IPYTHON_TESTING_TIMEOUT_SCALE
39 40
40 41 child.sendline("def f(x):")
41 42 child.sendline(" raise Exception")
@@ -17,6 +17,7 import sys
17 17 import nose.tools as nt
18 18 from IPython.utils.tempdir import NamedFileInTemporaryDirectory
19 19 from IPython.testing.decorators import skip_win32
20 from IPython.testing import IPYTHON_TESTING_TIMEOUT_SCALE
20 21
21 22 #-----------------------------------------------------------------------------
22 23 # Tests
@@ -72,7 +73,7 def test_nest_embed():
72 73
73 74 child = pexpect.spawn(sys.executable, ['-m', 'IPython', '--colors=nocolor'],
74 75 env=env)
75 child.timeout = 5
76 child.timeout = 5 * IPYTHON_TESTING_TIMEOUT_SCALE
76 77 child.expect(ipy_prompt)
77 78 child.sendline("import IPython")
78 79 child.expect(ipy_prompt)
@@ -8,6 +8,9
8 8 # the file COPYING, distributed as part of this software.
9 9 #-----------------------------------------------------------------------------
10 10
11
12 import os
13
11 14 #-----------------------------------------------------------------------------
12 15 # Functions
13 16 #-----------------------------------------------------------------------------
@@ -33,6 +36,14 def test(**kwargs):
33 36 setattr(options, name, val)
34 37 run_iptestall(options)
35 38
39 #-----------------------------------------------------------------------------
40 # Constants
41 #-----------------------------------------------------------------------------
42
43 # We scale all timeouts via this factor, slow machines can increase it
44 IPYTHON_TESTING_TIMEOUT_SCALE = float(os.getenv(
45 'IPYTHON_TESTING_TIMEOUT_SCALE', 1))
46
36 47 # So nose doesn't try to run this as a test itself and we end up with an
37 48 # infinite test loop
38 49 test.__test__ = False
General Comments 0
You need to be logged in to leave comments. Login now