Top "Pytest" questions

Simple powerful no-boilerplate testing with Python.

pytest running with another version of python

I've installed pyenv and have different versions of python installed with it: $ pyenv versions system 2.7.1 3.2.5 3.5.0 3.5.1 * 3.5.2 I use the following command …

python linux pytest pyenv
Can I pass arguments to pytest fixtures?

The baseline of all my tests is that there will always be a taxi with at least one passenger in …

python pytest fixtures
In which order are pytest fixtures executed?

For an application I'm testing I'd like to create an autouse=True fixture which monkeypatches smtplib.SMTP.connect to fail …

python fixtures pytest
What to do when a py.test hangs silently?

While using py.test, I have some tests that run fine with SQLite but hang silently when I switch to …

sqlite postgresql timeout freeze pytest
Python: Comparing two JSON objects in pytest

I have an API that returns this JSON response { "message": "Staff name and password pair not match", "errors": { "resource": "Login", "…

python json pytest object-comparison
Pytest: Deselecting tests

With pytest, one can mark tests using a decorator @pytest.mark.slow def some_slow_test(): pass Then, from the …

python pytest
py.test gives Coverage.py warning: Module sample.py was never imported

I ran a sample code from this thread. How to properly use coverage.py in Python? However, when I executed …

pytest coverage.py
VS Code not finding pytest tests

I have PyTest setup in vs-code but none of the tests are being found even though running pytest from the …

python python-3.x visual-studio-code pytest pytest-django
How to speed up pytest

Is there some way to speed up the repeated execution of pytest? It seems to spend a lot of time …

python performance pytest