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