We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a481b55 commit 91e617aCopy full SHA for 91e617a
testtools/testcase.py
@@ -735,7 +735,17 @@ def _run_teardown(self, result):
735
736
def _get_test_method(self):
737
method_name = getattr(self, "_testMethodName")
738
- return getattr(self, method_name)
+ try:
739
+ m = getattr(self, method_name)
740
+ except AttributeError:
741
+ if method_name != "runTest":
742
+ # We allow instantiation with no explicit method name
743
+ # but not an *incorrect* or missing method name.
744
+ raise ValueError(
745
+ "no such test method in %s: %s" % (self.__class__, method_name)
746
+ )
747
+ else:
748
+ return m
749
750
def _run_test_method(self, result):
751
"""Run the test method for this test.
0 commit comments