Fix persistence issue in test_app_id_special_chars#1056
Conversation
Split shared service into two (headers and query) so credentials_location is not mutated between parametrized tests. Fixes 403 on persistence load when headers test runs after query test overwrote the setting.
|
can't we put service_1 if _ else service_2 into the @pytest.parametrize? |
I don't think so. Parametrize values are resolved at collection time, before fixtures are instantiated, so we can't reference fixture objects there. But I might be missing something, do you have a specific approach in mind? |
| pytest.param( | ||
| "!#$&'(h", | ||
| "keykey2", | ||
| "headers", |
There was a problem hiding this comment.
if there is "headers" why not put here header_service fixture directly (query_fixture instead of "query"), similar how we in some tests use either prod_client or api_client.
There was a problem hiding this comment.
Good point, but credentials_location is also used in the assertion (line 236) to decide whether to check headers or params, so we'd still need it as a value, not just a fixture reference.
Split shared service into two (headers and query) so credentials_location is not mutated between parametrized tests. Fixes 403 on persistence load when headers test runs after query test overwrote the setting.
reproducer:
pipenv run python -m pytest -m 'not flaky' --fuzz --drop-nopersistence --store x testsuite/tests/fuzz/test_app_id_special_chars.pypipenv run python -m pytest -m 'not flaky' --fuzz --drop-nopersistence --load x testsuite/tests/fuzz/test_app_id_special_chars.py