File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -940,6 +940,14 @@ def register_pack(dog_type):
940940 def track_pack (cls , scent ):
941941 pass
942942
943+ @classmethod
944+ def classify_pack (dog_type ):
945+ pass
946+
947+ @staticmethod
948+ def tag_pack (label ):
949+ pass
950+
943951class Poodle (metaclass = DogMeta ):
944952 pass
945953
@@ -1042,6 +1050,18 @@ def test_metaclass_method_too_many_args_does_not_suggest_missing_self(self):
10421050 with self .check_raises_type_error (msg ):
10431051 Poodle .track_pack ("trail" , "river" )
10441052
1053+ def test_metaclass_classmethod_does_not_suggest_missing_self (self ):
1054+ """A classmethod on a metaclass should not suggest instance self."""
1055+ msg = "DogMeta.classify_pack() takes 1 positional argument but 2 were given"
1056+ with self .check_raises_type_error (msg ):
1057+ Poodle .classify_pack ("standard" )
1058+
1059+ def test_metaclass_staticmethod_does_not_suggest_missing_self (self ):
1060+ """A staticmethod on a metaclass should not suggest instance self."""
1061+ msg = "DogMeta.tag_pack() takes 1 positional argument but 2 were given"
1062+ with self .check_raises_type_error (msg ):
1063+ Poodle .tag_pack ("show" , "working" )
1064+
10451065@cpython_only
10461066class TestErrorMessagesSuggestions (unittest .TestCase ):
10471067 @contextlib .contextmanager
You can’t perform that action at this time.
0 commit comments