Pytest error: unrecognized arguments: --doctest-rst

Hello,

I am running through the setup instructions for contributing to Astropy here and just got to the point where I’m trying to test astropy/coordinates.

I am running pytest astropy\coordinates in a Miniforge prompt and receiving the below error. I saw some other posts related to this error, but they are a few years old and I couldn’t find any recent solutions. I just forked the whole repo, so I figured this had to have been solved already and I must be doing something wrong. Can anyone help?

(astropy-dev) <astropy_project_location>>pytest astropy/coordinates
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --doctest-rst
  inifile: <astropy_project_location>\pyproject.toml
  rootdir: <astropy_project_location>

Thanks,

Brendon

Can you check if you have installed pytest-astropy into your environment?

I did not have that installed. I initially just installed pytest. Installing pytest-astropy solved the problem. Thanks!

No problem, there might be other packages missing as well if you run other tests.

I think that astropy has a `pip install -e “.[tests]” option to ensure that all dependencies are installed.

1 Like