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