TST: Remove arbitrary pytest markers and replace ccd_data fixture
See original GitHub issueAs @bsipocz pointed out, pytest
emits the following warning in nddata
tests (turned into error in this exercise), which we currently ignore:
__ ERROR collecting astropy/nddata/tests/test_ccddata.py __
astropy/nddata/tests/test_ccddata.py:98: in <module>
@pytest.mark.data_size(10)
.../_pytest/mark/structures.py:337: in __getattr__
PytestUnknownMarkWarning,
E _pytest.warning_types.PytestUnknownMarkWarning: Unknown pytest.mark.data_size
- is this a typo? You can register custom marks to avoid this warning
- for details, see https://docs.pytest.org/en/latest/mark.html
This is because of
I think the tests would still work if we remove ccd_data
as a fixture, but rather re-implements it as a helper function that takes all those custom markers as regular arguments. Better yet, we can memoize that function so that requesting array of same size will return a cached copy instead of creating a new one from scratch (more memory usage but better performance). Given that ccd_data
generates random number and there is no reason why randomness has to be that random between different unit tests, memoization is probably okay?
What do you think, @mwcraig , @crawfordsm , or @MSeifert04 ?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top GitHub Comments
Okay, seems like we all agree. I could have a look into this if none of you is already working on that.
go for it!