diff --git a/contrib/runtesthelper.py b/contrib/runtesthelper.py new file mode 100644 index 000000000..a3d7c7be4 --- /dev/null +++ b/contrib/runtesthelper.py @@ -0,0 +1,19 @@ +""" +this little helper allows to run tests multiple times +in the same process. useful for running tests from +a console. +""" +import py, sys + +def pytest(argv=None): + if argv is None: + argv = [] + try: + sys.argv[1:] = argv + py.cmdline.pytest() + except SystemExit: + pass + # we need to reset the global py.test.config object + py._com.comregistry = py._com.comregistry.__class__([]) + py.test.config = py.test.config.__class__( + pluginmanager=py.test._PluginManager(py._com.comregistry))