Mixing bases with and without static properties should be possible and the result should be independent of base definition order
()
| 240 | |
| 241 | |
| 242 | def test_mi_static_properties(): |
| 243 | """Mixing bases with and without static properties should be possible |
| 244 | and the result should be independent of base definition order""" |
| 245 | |
| 246 | for d in (m.VanillaStaticMix1(), m.VanillaStaticMix2()): |
| 247 | assert d.vanilla() == "Vanilla" |
| 248 | assert d.static_func1() == "WithStatic1" |
| 249 | assert d.static_func2() == "WithStatic2" |
| 250 | assert d.static_func() == d.__class__.__name__ |
| 251 | |
| 252 | m.WithStatic1.static_value1 = 1 |
| 253 | m.WithStatic2.static_value2 = 2 |
| 254 | assert d.static_value1 == 1 |
| 255 | assert d.static_value2 == 2 |
| 256 | assert d.static_value == 12 |
| 257 | |
| 258 | d.static_value1 = 0 |
| 259 | assert d.static_value1 == 0 |
| 260 | d.static_value2 = 0 |
| 261 | assert d.static_value2 == 0 |
| 262 | d.static_value = 0 |
| 263 | assert d.static_value == 0 |
| 264 | |
| 265 | |
| 266 | def test_mi_dynamic_attributes(): |
nothing calls this directly
no test coverage detected