Exemple #1
0
 def test_get_test_modules(self) -> None:
     base_path = Path(__file__).parent
     stats = defaultdict(int)  # type: Dict[str, int]
     test_modules = ptr._get_test_modules(base_path, stats)
     self.assertEqual(
         test_modules[base_path / "setup.py"],
         ptr_tests_fixtures.EXPECTED_TEST_PARAMS,
     )
     self.assertEqual(stats["total.setup_pys"], 1)
     self.assertEqual(stats["total.ptr_setup_pys"], 1)
Exemple #2
0
 def test_get_test_modules(self, mock_print: Mock) -> None:
     base_path = Path(__file__).parent
     stats = defaultdict(int)  # type: Dict[str, int]
     test_modules = ptr._get_test_modules(base_path, stats, True, True)
     self.assertEqual(
         test_modules[base_path / "setup.py"],
         ptr_tests_fixtures.EXPECTED_TEST_PARAMS,
     )
     self.assertEqual(stats["total.non_ptr_setup_pys"], 0)
     self.assertEqual(stats["total.ptr_setup_pys"], 1)
     self.assertEqual(stats["total.setup_pys"], 1)
     # Make sure we don't run print even tho we set the option to True
     self.assertFalse(mock_print.called)