Closed stan-dot closed 6 months ago
We do actually want to run pytest on other directories as we want to run doctest on snippets in src
and docs
as per:
https://github.com/DiamondLightSource/python-copier-template/blob/3462fe957ee1f1e2c9495b413a965719f3103460/template/pyproject.toml.jinja#L67-L68
This means that a plain pytest
command will actually run pytest src docs tests ...
, which should make the addition in settings.json
unnecessary
Was this change needed to fix a particular problem?
bluesky/blueapi
for instance uses only that directory.
the particular problem was vscode not showing the testing left side panel straight away, but asking me to configure tests - first to choose between pytest and unittest and later about the location of directories.
we could add more than 1 location to the settings, that would also work.
@stan-dot unsure why it behaved that way for you, it works fine out-of-box for me
maybe it's because of devcontainers?
no, it's not because of devcontainers
@coretl vscode expects the config in its own json, it doesn't read clearly the pyproject.toml
solution - likely one needs to wait until the python extension is available
"python.testing.pytestArgs": [ "tests" ],
to vscode settings