rafsaf / minimal-fastapi-postgres-template

minimal-fastapi-postgres-template based on official template but rewritten
https://minimal-fastapi-postgres-template.rafsaf.pl
MIT License
456 stars 60 forks source link

Pytest options in pyproject.toml #51

Closed lybrain closed 5 months ago

lybrain commented 5 months ago

@rafsaf hello ! Could you please explain what does the following keys means ?

[tool.pytest.ini_options]
addopts = "-vv -n auto --cov --cov-report xml --cov-report term-missing --cov-fail-under=100"

From my understanding, -n auto sets number of workers to auto(based on CPU), and --cov --cov-report xml --cov-report term-missing --cov-fail-under=100 we're using for coverage information, but what about -vv ?

rafsaf commented 5 months ago

Hello, you are correct for -n auto (that's for pytest-xdist, numer of processes) and coverage flags (pycoverage). As of -vv it's for pytest itself, shortcut for --verbose (as far as I can tell writting from phone).

You can remove it completely, change to -v or even print more verbose output with -vvv if I remember correctly. Actually the same goes for other flags, this is just setup works for me.

lybrain commented 5 months ago

@rafsaf thank you for your answer !