From 9095c6f6d12fa787567904c8118fa55fbacd3a08 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Wed, 13 Nov 2024 11:30:09 +0100 Subject: [PATCH] fix: finer grained test categorization of legacy frappe test case (#28387) --- frappe/testing/discovery.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/frappe/testing/discovery.py b/frappe/testing/discovery.py index caba5522cd..136ed73229 100644 --- a/frappe/testing/discovery.py +++ b/frappe/testing/discovery.py @@ -134,14 +134,16 @@ def _add_module_tests(runner, app: str, module: str): case UnitTestCase(): category = "unit" case _: - from frappe.deprecation_dumpster import deprecation_warning + category = "unspecified-category" + if any(b.__name__ == "FrappeTestCase" for b in test.__class__.__bases__): + from frappe.deprecation_dumpster import deprecation_warning - deprecation_warning( - "2024-20-08", - "v17", - "discovery and categorization of FrappeTestCase will be removed from this runner", - ) - category = "deprecated-old-style-unspecified" + deprecation_warning( + "2024-20-08", + "v17", + "accurate categorization of FrappeTestCase will be removed from this runner", + ) + category = "old-frappe-test-class-category" if runner.cfg.selected_categories and category not in runner.cfg.selected_categories: continue runner.per_app_categories[app][category].addTest(test)