File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,8 +22,16 @@ def read_schema(
2222 if not "WhoAmI" in schema .registers and include_common_registers :
2323 common = _read_common_registers ()
2424 schema .registers = dict (common .registers , ** schema .registers )
25- if schema .bitMasks is not None and common .bitMasks is not None :
26- schema .bitMasks = dict (common .bitMasks , ** schema .bitMasks )
27- if schema .groupMasks is not None and common .groupMasks is not None :
28- schema .groupMasks = dict (common .groupMasks , ** schema .groupMasks )
25+ if common .bitMasks :
26+ schema .bitMasks = (
27+ common .bitMasks
28+ if schema .bitMasks is None
29+ else dict (common .bitMasks , ** schema .bitMasks )
30+ )
31+ if common .groupMasks :
32+ schema .groupMasks = (
33+ common .groupMasks
34+ if schema .groupMasks is None
35+ else dict (common .groupMasks , ** schema .groupMasks )
36+ )
2937 return schema
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def __post_init__(self):
5555
5656@mark .parametrize ("dataFile" , testdata )
5757def test_read (dataFile : DataFileParam ):
58- context = pytest .raises if dataFile .expected_error is not None else nullcontext
58+ context = pytest .raises if dataFile .expected_error else nullcontext
5959 with context (dataFile .expected_error ): # type: ignore
6060 data = read (
6161 dataFile .path ,
@@ -68,7 +68,7 @@ def test_read(dataFile: DataFileParam):
6868 if dataFile .keep_type :
6969 assert "type" in data .columns and data ["type" ].dtype == "category"
7070
71- if dataFile .expected_cols is not None :
71+ if dataFile .expected_cols :
7272 for col in dataFile .expected_cols :
7373 assert col in data .columns
7474
You can’t perform that action at this time.
0 commit comments