From 3ec116a1bb3646c2ff932bed24b4bf087b51cb8c Mon Sep 17 00:00:00 2001 From: Wesley Wiedenmeier Date: Fri, 17 Mar 2017 12:26:59 -0500 Subject: Integration Testing: improve testcase subclassing Use inspect.getmro(mod) rather than mod.__bases__ to test if a potential testcase class inherits from CloudTestCase. This allows testcases to be based on CloudTestCase indirectly, adding greater flexibility to the structure of test classes. --- tests/cloud_tests/testcases/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/cloud_tests/testcases') diff --git a/tests/cloud_tests/testcases/__init__.py b/tests/cloud_tests/testcases/__init__.py index 182c090a..a1d86d45 100644 --- a/tests/cloud_tests/testcases/__init__.py +++ b/tests/cloud_tests/testcases/__init__.py @@ -21,7 +21,7 @@ def discover_tests(test_name): raise ValueError('no test verifier found at: {}'.format(testmod_name)) return [mod for name, mod in inspect.getmembers(testmod) - if inspect.isclass(mod) and base_test in mod.__bases__ and + if inspect.isclass(mod) and base_test in inspect.getmro(mod) and getattr(mod, '__test__', True)] -- cgit v1.2.3