def build_images(doctests=()): import tests if not doctests: doctests = tests.find_doctests() suite = doctest.DocFileSuite(optionflags=doctest.ELLIPSIS, checker=tests.IgnoreNodeCountChecker(), *doctests) os.chdir('docs') result = unittest.TextTestRunner().run(suite) if not result.wasSuccessful(): sys.exit(1)