They are not unit tests, they are integration tests. Which in my experience makes unit-testing frameworks like pytest a poor fit. I’ve also had to write my own framework, for that reason, despite preferring pytest for unit-testing.
Depends on the project of course, but you can absolutely write integration tests with pytest. In my experience, it’s easy to @pytest.mark.integration the integration tests, then pass -m to the CLI to filter between integration and non-integration tests. You can load the environment-specific stuff in fixtures that are only used by those tests as well, and do setup/teardown with fixtures of course as needed.
Depends on the project of course, but you can absolutely write integration tests with pytest. In my experience, it’s easy to
@pytest.mark.integrationthe integration tests, then pass-mto the CLI to filter between integration and non-integration tests. You can load the environment-specific stuff in fixtures that are only used by those tests as well, and do setup/teardown with fixtures of course as needed.