Ejemplo n.º 1
0
 def discover_inner():
     if isinstance(self.test_path_or_test_case,
                   (TestCase, MetaTestCase)):
         # For testing purposes only.
         yield self.test_path_or_test_case()
         return
     for test_case_class in test_discovery.discover(
             self.test_path_or_test_case):
         override_bucket = self.bucket_overrides.get(
             MetaTestCase._cmp_str(test_case_class))
         if (self.bucket is None or
             (override_bucket is None
              and test_case_class.get_testify_bucket(
                  self.bucket_count, self.bucket_salt) == self.bucket)
                 or (override_bucket is not None
                     and override_bucket == self.bucket)):
             if not self.module_method_overrides or test_case_class.__name__ in self.module_method_overrides:
                 test_case = test_case_class(
                     suites_include=self.suites_include,
                     suites_exclude=self.suites_exclude,
                     suites_require=self.suites_require,
                     name_overrides=self.module_method_overrides.get(
                         test_case_class.__name__, None),
                     failure_limit=(self.failure_limit -
                                    self.failure_count)
                     if self.failure_limit else None,
                     debugger=self.debugger,
                 )
                 yield test_case
Ejemplo n.º 2
0
 def discover_tests():
     return [
         construct_test(test_case_class)
         for test_case_class in test_discovery.discover(
             self.test_path_or_test_case)
         if not self.module_method_overrides
         or test_case_class.__name__ in self.module_method_overrides
     ]
Ejemplo n.º 3
0
 def discover(self, test_path, bucket=None, bucket_count=None, bucket_overrides={}, bucket_salt=None):
     for test_case_class in test_discovery.discover(test_path):
         override_bucket = bucket_overrides.get(MetaTestCase._cmp_str(test_case_class))
         if (bucket is None
             or (override_bucket is None and test_case_class.bucket(bucket_count, bucket_salt) == bucket)
             or (override_bucket is not None and override_bucket == bucket)):
             if not self.module_method_overrides or test_case_class.__name__ in self.module_method_overrides:
                 self.add_test_case(test_case_class)
Ejemplo n.º 4
0
 def discover_inner():
     if isinstance(self.test_path_or_test_case, (TestCase, MetaTestCase)):
         # For testing purposes only.
         yield self.test_path_or_test_case()
         return
     for test_case_class in test_discovery.discover(self.test_path_or_test_case):
         override_bucket = self.bucket_overrides.get(MetaTestCase._cmp_str(test_case_class))
         if (self.bucket is None
             or (override_bucket is None and test_case_class.bucket(self.bucket_count, self.bucket_salt) == self.bucket)
             or (override_bucket is not None and override_bucket == self.bucket)):
             if not self.module_method_overrides or test_case_class.__name__ in self.module_method_overrides:
                 test_case = test_case_class(
                     suites_include=self.suites_include,
                     suites_exclude=self.suites_exclude,
                     suites_require=self.suites_require,
                     name_overrides=self.module_method_overrides.get(test_case_class.__name__, None),
                     failure_limit=(self.failure_limit - self.failure_count) if self.failure_limit else None,
                 )
                 yield test_case
Ejemplo n.º 5
0
 def discover_tests():
     return [
         construct_test(test_case_class)
         for test_case_class in test_discovery.discover(self.test_path_or_test_case)
         if not self.module_method_overrides or test_case_class.__name__ in self.module_method_overrides
     ]
Ejemplo n.º 6
0
 def discover_tests():
     return map(construct_test, test_discovery.discover(self.test_path_or_test_case))