File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change
1
+ import abc
1
2
import sys
2
3
3
4
import pytest
@@ -227,6 +228,22 @@ def test_metaclass_override():
227
228
assert isinstance (m .MetaclassOverride .__dict__ ["readonly" ], int )
228
229
229
230
231
+ def test_abc_meta_incompatibility (): # Mostly to clearly expose the behavior.
232
+ with pytest .raises (TypeError ) as exc_info :
233
+
234
+ class ExampleMandAABC (m .ExampleMandA , metaclass = abc .ABCMeta ):
235
+ pass
236
+
237
+ assert "metaclass conflict" in str (exc_info .value )
238
+
239
+
240
+ def test_abc_meta_compatibility ():
241
+ class MetaclassOverrideABC (m .MetaclassOverride , metaclass = abc .ABCMeta ):
242
+ pass
243
+
244
+ assert type (MetaclassOverrideABC ).__name__ == "ABCMeta"
245
+
246
+
230
247
def test_no_mixed_overloads ():
231
248
from pybind11_tests import detailed_error_messages_enabled
232
249
You can’t perform that action at this time.
0 commit comments