rstudio / pins-python

https://rstudio.github.io/pins-python/
MIT License
50 stars 12 forks source link

Register all markers in pytest config #259

Closed nathanjmcdougall closed 2 months ago

nathanjmcdougall commented 2 months ago

Currently omitting a warning when running tests from the root dir:

PytestUnknownMarkWarning: Unknown pytest.mark.fs_file - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html

This was my mistake - should be running tests from pins folder with pytest pins rather than pytest .

This drew my attention to this section of conftest.py: https://github.com/rstudio/pins-python/blob/70380b4532f3778e4777888507a49c2d1cab1ae8/pins/tests/conftest.py#L94-L100 This is the only place where the BACKEND_MARKS variable is used, so I reckon rather than dynamically creating these registrations, they can just be hardcoded in the pyproject.toml, which already contains configuration for markers, specifically for skip_on_github. https://github.com/rstudio/pins-python/blob/70380b4532f3778e4777888507a49c2d1cab1ae8/pyproject.toml#L5-L11

I'd like to move this configuration into the pyproject.toml.