Пример #1
0
    def run_tests(self):
        auto_reload = False
        if '-a' in sys.argv or '--autoreload' in sys.argv:
            auto_reload = True

        if auto_reload:
            from django.utils.autoreload import restart_with_reloader, reloader_thread
            if os.environ.get("RUN_MAIN") == "true":
                try:
                    TestCommand.run_tests(self)
                except LabelException:
                    sys.exit(1)
                except:
                    pass
                try:
                    reloader_thread()
                except KeyboardInterrupt:
                    pass
            else:
                try:
                    sys.exit(restart_with_reloader())
                except KeyboardInterrupt:
                    pass
        else:
            return TestCommand.run_tests(self)
Пример #2
0
    def run_tests(self):
        """
        Actually run the tests, but start with
            passing the filter options via __builtin__
            set sys.path
            reload vsc modules
        """
        getattr(__builtin__,'__test_filter').update({
            'function': self.test_filterf,
            'module': self.test_filterm,
        })

        if self.test_xmlrunner is not None:
            if not have_xmlrunner:
                raise Exception('test-xmlrunner requires xmlrunner module')
            self.force_xmlrunner()

        cleanup = self.setup_sys_path()

        if RELOAD_VSC_MODS:
            self.reload_vsc_modules()

        res = TestCommand.run_tests(self)

        # clenaup any diretcories created
        for directory in cleanup:
            shutil.rmtree(directory)

        return res
Пример #3
0
    def run_tests(self):
        """
        Actually run the tests, but start with
            passing the filter options via __builtin__
            set sys.path
            reload vsc modules
        """
        getattr(__builtin__,'__test_filter').update({
            'function': self.test_filterf,
            'module': self.test_filterm,
        })

        if self.test_xmlrunner is not None:
            if not have_xmlrunner:
                raise Exception('test-xmlrunner requires xmlrunner module')
            self.force_xmlrunner()

        cleanup = self.setup_sys_path()

        if RELOAD_VSC_MODS:
            self.reload_modules('vsc')

        # e.g. common names like test can have existing packages
        if not DEFAULT_TEST_SUITE in sys.modules:
            __import__(DEFAULT_TEST_SUITE)
        self.reload_modules(DEFAULT_TEST_SUITE)

        res = TestCommand.run_tests(self)

        # cleanup any diretcories created
        for directory in cleanup:
            shutil.rmtree(directory)

        return res
Пример #4
0
 def run_tests(self, *args, **kwds):
     # Ensure we keep a reference to multiprocessing and pysnmp to
     # avoid errors at the end of the test
     import multiprocessing
     import pysnmp
     SnimpyTestCommand.multiprocessing = multiprocessing
     SnimpyTestCommand.pysnmp = pysnmp
     return test.run_tests(self, *args, **kwds)
Пример #5
0
 def run_tests(self, *args, **kwds):
     # Ensure we keep a reference to multiprocessing and pysnmp to
     # avoid errors at the end of the test
     import multiprocessing
     import pysnmp
     SnimpyTestCommand.multiprocessing = multiprocessing
     SnimpyTestCommand.pysnmp = pysnmp
     return test.run_tests(self, *args, **kwds)
Пример #6
0
 def run_tests(self):
     os.environ['__TAUCMDR_DISABLE_PAGER__'] = '1'
     if self.system_sandbox:
         tmp_system_prefix = tempfile.mkdtemp()
         os.environ['__TAUCMDR_SYSTEM_PREFIX__'] = tmp_system_prefix
         print "Sandboxing system storage: %s" % tmp_system_prefix
     if self.user_sandbox:
         tmp_user_prefix = tempfile.mkdtemp()
         os.environ['__TAUCMDR_USER_PREFIX__'] = tmp_user_prefix
         print "Sandboxing user storage: %s" % tmp_user_prefix
     args = ['--buffer']
     self.test_args = args + self.test_args
     try:
         return TestCommand.run_tests(self)
     finally:
         if self.system_sandbox:
             shutil.rmtree(tmp_system_prefix, ignore_errors=True)
         if self.user_sandbox:
             shutil.rmtree(tmp_user_prefix, ignore_errors=True)
Пример #7
0
 def run_tests(self):
     os.environ['__TAUCMDR_DISABLE_PAGER__'] = '1'
     if self.system_sandbox:
         tmp_system_prefix = tempfile.mkdtemp()
         os.environ['__TAUCMDR_SYSTEM_PREFIX__'] = tmp_system_prefix
         print "Sandboxing system storage: %s" % tmp_system_prefix
     if self.user_sandbox:
         tmp_user_prefix = tempfile.mkdtemp()
         os.environ['__TAUCMDR_USER_PREFIX__'] = tmp_user_prefix
         print "Sandboxing user storage: %s" % tmp_user_prefix
     args = ['--buffer']
     self.test_args = args + self.test_args
     try:
         return TestCommand.run_tests(self)
     finally:
         if self.system_sandbox:
             shutil.rmtree(tmp_system_prefix, ignore_errors=True)
         if self.user_sandbox:
             shutil.rmtree(tmp_user_prefix, ignore_errors=True)
Пример #8
0
 def run_tests(self):
     self.test_args = ["-b"] + self.test_args
     test.run_tests(self)
Пример #9
0
 def run_tests(self):
     self.test_args = ["-b"] + self.test_args
     test.run_tests(self)
Пример #10
0
 def run_tests(self):
     from pyphant.mplbackend import ensure_mpl_backend
     ensure_mpl_backend('agg')
     return test.run_tests(self)
Пример #11
0
 def run_tests(self):
     from pyphant.mplbackend import ensure_mpl_backend
     ensure_mpl_backend('agg')
     return test.run_tests(self)
Пример #12
0
 def run_tests(self, *args, **kwargs):
     TestCommand.run_tests(self, *args, **kwargs)
     self._run(['flake8', 'rpncalculator', 'test', 'setup.py'])
Пример #13
0
 def run_tests(self):
     os.environ["LEDGERX_TEST"] = "true"
     TestCommand.run_tests(self)