def test_get_subclass(self): with self.assertRaises(RuntimeError): MemberBits._get_subclass('Ints', (1, 2, 3, 4, 5, 6), None, None, None) self.assertIsInstance( MemberBits._get_subclass('Ints', (1, 2, 3, 4, 5, 6), -1, None, None), MemberBits.__class__)
def test_get_subclass(Ints): # noqa: N803 assert isinstance( MemberBits._get_subclass('Ints', (1, 2, 3, 4, 5, 6), -1, None, None), MemberBits.__class__)
def test_get_subclass_invalid_id(Ints): # noqa: N803 with pytest.raises(RuntimeError, match=r'non-integer id'): MemberBits._get_subclass('Ints', (1, 2, 3, 4, 5, 6), None, None, None)