diff --git a/frappe/parallel_test_runner.py b/frappe/parallel_test_runner.py index 84bbf8bf2f..9459c3b586 100644 --- a/frappe/parallel_test_runner.py +++ b/frappe/parallel_test_runner.py @@ -88,8 +88,6 @@ class ParallelTestRunner: frappe.set_user("Administrator") path, filename = file_info module = self.get_module(path, filename) - if "erpnext" in path: - self._pre_create_test_dependency_records(module, path, filename) test_suite = unittest.TestSuite() module_test_cases = unittest.TestLoader().loadTestsFromModule(module) test_suite.addTest(module_test_cases) @@ -97,27 +95,6 @@ class ParallelTestRunner: test_suite(self.test_result) self.test_result.stopTestRun() - # If an app depends on pre-creation, its tests should be revised to - # manage state in such a way that created during IntegrationTestCase.setUpClass - # is suitable - def _pre_create_test_dependency_records(self, module, path, filename): - if hasattr(module, "test_dependencies"): - for doctype in module.test_dependencies: - make_test_records(doctype, commit=True) - if hasattr(module, "EXTRA_TEST_RECORD_DEPENDENCIES"): - for doctype in module.EXTRA_TEST_RECORD_DEPENDENCIES: - make_test_records(doctype, commit=True) - - if os.path.basename(os.path.dirname(path)) == "doctype": - # test_data_migration_connector.py > data_migration_connector.json - test_record_filename = re.sub("^test_", "", filename).replace(".py", ".json") - test_record_file_path = os.path.join(path, test_record_filename) - if os.path.exists(test_record_file_path): - with open(test_record_file_path) as f: - doc = json.loads(f.read()) - doctype = doc["name"] - make_test_records(doctype, commit=True) - def get_module(self, path, filename): app_path = frappe.get_app_path(self.app) relative_path = os.path.relpath(path, app_path)