Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

[Tech Debt] Update config. vars in Pytest fixtures #606

Open
seanpreston opened this issue Jun 7, 2022 · 0 comments
Open

[Tech Debt] Update config. vars in Pytest fixtures #606

seanpreston opened this issue Jun 7, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@seanpreston
Copy link
Contributor

seanpreston commented Jun 7, 2022

Throughout our test suite there are many areas where we update config. vars within a test.

config.execution.MASKING_STRICT = ...

This isn't ideal because if the test halts mid-execution, the value is never reset and could cause cascade failures into other tests. A better solution is to use a pytest fixture:

@pytest.fixture
def with_strict_masking():
    config.execution.MASKING_STRICT = False
    yield
    config.execution.MASKING_STRICT = True

as these will clean-up after themselves if the test fails.

Another option is to override pytest.ini vars directly.

@seanpreston seanpreston added the enhancement New feature or request label Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant