Commit 0372035
authored
Fix RowsEvent.__is_null usage in tests (#374)
The test `TestDataType::test_null_bitmask` currently fails with
```
AttributeError: type object 'RowsEvent' has no attribute '_TestDataType__is_null'`
```
The test method in the `TestDataType` class calls the `__is_null` method of the
`RowsEvent` class. Due to name mangling of "private" methods/variables in
Python [1] the calling class name is prepended to the method name. This makes
the call fail when called from a foreign class.
This commit fixes that by
a) Renaming `__is_null` to `_is_null` which is only "private" by convention and
involves no name mangling.
b) Makes the method a staticmethod, as it's not depending on any instances or
class attributes/ methods, and is referenced by class only (and not by
instance) in the test.
[1] https://docs.python.org/3/tutorial/classes.html#private-variables1 parent f5ff4d9 commit 0372035
2 files changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
649 | 650 | | |
650 | 651 | | |
651 | 652 | | |
652 | | - | |
| 653 | + | |
653 | 654 | | |
654 | 655 | | |
655 | 656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | | - | |
| 733 | + | |
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
| |||
0 commit comments