Some warning can cause problems when running tests with pytest. It might be desirable to ignore all warnings. I could not find a clear way to suppress all warnings.
This is the solution I found:
pytest -W ignore test_script.py