def _add_test_hook_stats(self, test_file, duration, num_run):
     """Add the statistics for a hook."""
     test_name = testname.split_test_hook_name(test_file)[0]
     self._add_runtime_info(self._hook_runtime_by_test, test_name, duration, num_run)
 def _add_test_hook_stats(self, test_file, duration, num_run):
     """Add the statistics for a hook."""
     test_name = testname.split_test_hook_name(test_file)[0]
     self._add_runtime_info(self._hook_runtime_by_test, test_name, duration, num_run)
예제 #3
0
 def test_split_test_hook_name_should_throw_exception(self):
     with self.assertRaises(AssertionError):
         testname_utils.split_test_hook_name("test")
예제 #4
0
    def test_split_test_hook_returns_test_name_and_hook(self):
        (test_name, hook_name) = testname_utils.split_test_hook_name("test:hook")

        self.assertEqual(test_name, "test")
        self.assertEqual(hook_name, "hook")
예제 #5
0
 def hook_name(self) -> str:
     """Get the name of this hook."""
     return split_test_hook_name(self.hook_id)[-1]
예제 #6
0
 def test_name(self) -> str:
     """Get the name of the test associated with this hook."""
     return split_test_hook_name(self.hook_id)[0]
예제 #7
0
 def _add_test_hook_stats(self, test_file: str, duration: float, num_run: int) -> None:
     """Add the statistics for a hook."""
     test_name, hook_name = testname.split_test_hook_name(test_file)
     self._hook_runtime_by_test[test_name][hook_name].add_runtimes(duration, num_run)