0
在以下代碼中,「_get_classes」方法正常,但「_get_tests」會引發上述錯誤。我在這裏做錯了什麼?TypeError:必須使用Loader實例調用未綁定的方法_get_tests()作爲第一個參數(取而代之)
def my_func():
x = Loader._get_classes("test","number") # This works fine
y = Loader._get_tests("abc","def","ghi") # This does not work
class Loader(object):
def _get_classes(f, prefix_class_name=None):
#code here
def _get_tests(self, module_name, test_class, prefix_test_name):
#code here