##// END OF EJS Templates
Exclude slow tests (IPython.parallel by default in iptest
Thomas Kluyver -
Show More
@@ -13,7 +13,7 b''
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14
14
15 # User-level entry point for testing
15 # User-level entry point for testing
16 def test():
16 def test(all=False):
17 """Run the entire IPython test suite.
17 """Run the entire IPython test suite.
18
18
19 For fine-grained control, you should use the :file:`iptest` script supplied
19 For fine-grained control, you should use the :file:`iptest` script supplied
@@ -22,7 +22,7 b' def test():'
22 # Do the import internally, so that this function doesn't increase total
22 # Do the import internally, so that this function doesn't increase total
23 # import time
23 # import time
24 from iptest import run_iptestall
24 from iptest import run_iptestall
25 run_iptestall()
25 run_iptestall(inc_slow=all)
26
26
27 # So nose doesn't try to run this as a test itself and we end up with an
27 # So nose doesn't try to run this as a test itself and we end up with an
28 # infinite test loop
28 # infinite test loop
@@ -420,7 +420,7 b' class IPTester(object):'
420 print('... failed. Manual cleanup may be required.'
420 print('... failed. Manual cleanup may be required.'
421 % subp.pid)
421 % subp.pid)
422
422
423 def make_runners():
423 def make_runners(inc_slow=False):
424 """Define the top-level packages that need to be tested.
424 """Define the top-level packages that need to be tested.
425 """
425 """
426
426
@@ -430,6 +430,7 b' def make_runners():'
430
430
431 if have['zmq']:
431 if have['zmq']:
432 nose_pkg_names.append('zmq')
432 nose_pkg_names.append('zmq')
433 if inc_slow:
433 nose_pkg_names.append('parallel')
434 nose_pkg_names.append('parallel')
434
435
435 # For debugging this code, only load quick stuff
436 # For debugging this code, only load quick stuff
@@ -492,16 +493,23 b' def run_iptest():'
492 TestProgram(argv=argv, addplugins=plugins)
493 TestProgram(argv=argv, addplugins=plugins)
493
494
494
495
495 def run_iptestall():
496 def run_iptestall(inc_slow=False):
496 """Run the entire IPython test suite by calling nose and trial.
497 """Run the entire IPython test suite by calling nose and trial.
497
498
498 This function constructs :class:`IPTester` instances for all IPython
499 This function constructs :class:`IPTester` instances for all IPython
499 modules and package and then runs each of them. This causes the modules
500 modules and package and then runs each of them. This causes the modules
500 and packages of IPython to be tested each in their own subprocess using
501 and packages of IPython to be tested each in their own subprocess using
501 nose.
502 nose.
503
504 Parameters
505 ----------
506
507 inc_slow : bool, optional
508 Include slow tests, like IPython.parallel. By default, these tests aren't
509 run.
502 """
510 """
503
511
504 runners = make_runners()
512 runners = make_runners(inc_slow=inc_slow)
505
513
506 # Run the test runners in a temporary dir so we can nuke it when finished
514 # Run the test runners in a temporary dir so we can nuke it when finished
507 # to clean up any junk files left over by accident. This also makes it
515 # to clean up any junk files left over by accident. This also makes it
@@ -558,8 +566,13 b' def main():'
558 # This is in-process
566 # This is in-process
559 run_iptest()
567 run_iptest()
560 else:
568 else:
569 if "--all" in sys.argv:
570 sys.argv.remove("--all")
571 inc_slow = True
572 else:
573 inc_slow = False
561 # This starts subprocesses
574 # This starts subprocesses
562 run_iptestall()
575 run_iptestall(inc_slow=inc_slow)
563
576
564
577
565 if __name__ == '__main__':
578 if __name__ == '__main__':
General Comments 0
You need to be logged in to leave comments. Login now