File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 69
69
import pytest
70
70
from pytest import WarningsRecorder
71
71
72
- from git .cmd import Git
72
+ from git .cmd import Git , GitMeta
73
73
74
74
from .lib import assert_no_deprecation_warning , suppress_deprecation_warning
75
75
@@ -377,3 +377,15 @@ def test_instance_dir() -> None:
377
377
instance = Git ()
378
378
actual = set (dir (instance ))
379
379
assert _EXPECTED_DIR_SUBSET <= actual
380
+
381
+
382
+ def test_metaclass_alias () -> None :
383
+ """GitMeta aliases Git's metaclass, whether that is type or a custom metaclass."""
384
+
385
+ def accept_metaclass_instance (cls : GitMeta ) -> None :
386
+ """Check that cls is statically recognizable as an instance of GitMeta."""
387
+
388
+ accept_metaclass_instance (Git ) # assert_type would expect Type[Git], not GitMeta.
389
+
390
+ # This comes after the static check, just in case it would affect the inference.
391
+ assert type (Git ) is GitMeta
You can’t perform that action at this time.
0 commit comments