Skip to content

v2.0.x Chore - better test loading #232

Closed
@reactive-firewall

Description

@reactive-firewall

better test loading

Consider the following changes to tests/__init__.py:

-    suite.addTests(doctest.DocTestSuite(module=multicast, test_finder=finder))
-    suite.addTests(doctest.DocTestSuite(module=multicast.exceptions, test_finder=finder))
-    suite.addTests(doctest.DocTestSuite(module=multicast.skt, test_finder=finder))
-    suite.addTests(doctest.DocTestSuite(module=multicast.recv, test_finder=finder))
-    suite.addTests(doctest.DocTestSuite(module=multicast.send, test_finder=finder))
-    suite.addTests(doctest.DocTestSuite(module=multicast.hear, test_finder=finder))
+    modules_to_test = [
+        multicast, multicast.exceptions, multicast.skt,
+        multicast.recv, multicast.send, multicast.hear
+    ]
+    for module in modules_to_test:
+        try:
+            suite.addTests(doctest.DocTestSuite(module=module, test_finder=finder))
+        except ValueError as e:
+            # ValueError is raised when no tests are found
+            print(f"No doctests found in {module.__name__}: {e}")
+        except Exception as e:
+            print(f"Error loading doctests from {module.__name__}: {e}")

Metadata

Metadata

Labels

CIContinuous Integration ToolingChoreMiscellaneous chores to maintain the projectMulticastAny main project file changesPython LangChanges to Python source codeTestingSomething can be verified

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions