Data classes are not supposed to allow mutable default values. Starting with Python 3.11, Python is stricter about this, checking for the hashability of default values (rather than checking against a list of types). Many of the tests are set up by creating data classes containing DataFrames or np.arrays, which are mutable and thus, in Python, not hashable. So, attempting to run pytest under Python 3.11 was generating lots of errors and no useful testing. Got around this by wrapping all the hand-crafted arrays and things with a field containing a lambda returning the thing.
Note that with this fix, we're still not passing all the pytest tests-- I'll open an issue for the other problem.
Data classes are not supposed to allow mutable default values. Starting with Python 3.11, Python is stricter about this, checking for the hashability of default values (rather than checking against a list of types). Many of the tests are set up by creating data classes containing DataFrames or np.arrays, which are mutable and thus, in Python, not hashable. So, attempting to run
pytest
under Python 3.11 was generating lots of errors and no useful testing. Got around this by wrapping all the hand-crafted arrays and things with a field containing a lambda returning the thing.Note that with this fix, we're still not passing all the pytest tests-- I'll open an issue for the other problem.