Debian Codegraph @

extra_tests/ctypes_tests/test_bitfields.py

raw symbols SCIP
1 import pytest
2 from ctypes import *
3
4
5 def test_set_fields_attr():
6 class A(Structure):
7 pass
8 A._fields_ = [("a", c_byte), ("b", c_ubyte)]
9
10 def test_set_fields_attr_bitfields():
11 class A(Structure):
12 pass
13 A._fields_ = [("a", POINTER(A)), ("b", c_ubyte, 4)]
14
15 def test_set_fields_cycle_fails():
16 class A(Structure):
17 pass
18 with pytest.raises(AttributeError):
19 A._fields_ = [("a", A)]