Ejemplo n.º 1
0
    def run(self):
        import tests

        count, failures = tests.unit(self.to_run, self.exitfirst)
        if failures:
            print("%d out of %d failed" % (failures, count))
            raise SystemExit("Test failures are listed above.")
Ejemplo n.º 2
0
    def run(self):
        import tests

        count, failures = tests.unit(self.to_run, self.quick)
        if failures:
            print("%d out of %d failed" % (failures, count))
            raise SystemExit("Test failures are listed above.")
Ejemplo n.º 3
0
    def run(self):
        mods = sys.modules.keys()
        if "gi" in mods:
            raise SystemExit("E: setup.py shouldn't depend on gi")

        import tests

        main = False
        if not self.suite or self.all:
            main = True

        subdirs = []
        if self.all:
            test_path = tests.__path__[0]
            for entry in os.listdir(test_path):
                if os.path.isdir(os.path.join(test_path, entry)):
                    subdirs.append(entry)
        elif self.suite:
            subdirs.append(self.suite)

        failures, errors, all_ = tests.unit(self.to_run,
                                            main=main,
                                            subdirs=subdirs,
                                            strict=self.strict,
                                            stop_first=self.exitfirst)
        if failures or errors:
            raise SystemExit(
                self._red("%d test failure(s) and "
                          "%d test error(s) for %d tests." %
                          (failures, errors, all_)))
Ejemplo n.º 4
0
    def run(self):
        mods = sys.modules.keys()
        if "gi" in mods:
            raise SystemExit("E: setup.py shouldn't depend on gi")

        import tests

        main = False
        if not self.suite or self.all:
            main = True

        subdirs = []
        if self.all:
            test_path = tests.__path__[0]
            for entry in os.listdir(test_path):
                if os.path.isdir(os.path.join(test_path, entry)):
                    subdirs.append(entry)
        elif self.suite:
            subdirs.append(self.suite)

        failures, errors, all_ = tests.unit(
            self.to_run, main=main, subdirs=subdirs,
            strict=self.strict, stop_first=self.exitfirst)
        if failures or errors:
            raise SystemExit(self._red("%d test failure(s) and "
                                       "%d test error(s) for %d tests."
                             % (failures, errors, all_)))
Ejemplo n.º 5
0
    def run(self):
        import tests

        count, failures = tests.unit(self.to_run, self.quick)
        if failures:
            print("%d out of %d failed" % (failures, count))
            raise SystemExit("Test failures are listed above.")
        else:
            print("All tests passed")
Ejemplo n.º 6
0
    def run(self):
        import tests

        suite = self.suite
        if self.all:
            suite = None

        status = tests.unit(run=self.to_run, suite=suite,
                            strict=self.strict, exitfirst=self.exitfirst,
                            network=(not self.no_network or self.all),
                            quality=self.all)
        if status != 0:
            raise SystemExit(status)
Ejemplo n.º 7
0
    def run(self):
        import tests

        suite = self.suite
        if self.all:
            suite = None

        status = tests.unit(run=self.to_run, suite=suite,
                            strict=self.strict, exitfirst=self.exitfirst,
                            network=(not self.no_network or self.all),
                            quality=(not self.no_quality or self.all))
        if status != 0:
            raise SystemExit(status)
Ejemplo n.º 8
0
    def run(self):
        import tests

        if tests.unit(self.to_run, self.quick):
            raise SystemExit("Test failures are listed above.")
Ejemplo n.º 9
0
    def run(self):
        import tests

        status = tests.unit(self.to_run, self.exitfirst, self.no_quality)
        if status != 0:
            raise SystemExit(status)
Ejemplo n.º 10
0
    def run(self):
        import tests

        status = tests.unit(suite="quality", quality=True)
        if status != 0:
            raise SystemExit(status)
Ejemplo n.º 11
0
    def run(self):
        import tests

        status = tests.unit(suite="quality", quality=True)
        if status != 0:
            raise SystemExit(status)
Ejemplo n.º 12
0
 def __test(self, filter=None):
     import tests
     if tests.unit(self.to_run, filter):
         if sys.version[:3] == (2, 4, 2):
             print("You're running Python 2.4.2, which has known mmap bugs.")
         raise SystemExit("Test failures are listed above.")
Ejemplo n.º 13
0
 def __test(self, filter=None):
     import tests
     if tests.unit(self.to_run, filter):
         if sys.version[:3] == (2, 4, 2):
             print "You're running Python 2.4.2, which has known mmap bugs."
         raise SystemExit("Test failures are listed above.")
Ejemplo n.º 14
0
 def run(self):
     import tests
     if tests.unit(self.to_run):
         raise SystemExit("Test failures are listed above.")