dotenv-linter
dotenv-linter copied to clipboard
Test each unique violation
We need to create integration tests for all violations.
How should it look like?
- We create a folder
tests/fixtures/integration
- We create a folder called
tests/test_violations/
where all other tests will be located - Inside
tests/test_violations/
we create a singletest_VIOLATION_TYPE/
subfolder for all violation types - Then we create individual tests file for each violation class in the corresponding types subfolders
How should it work?
- We create a fixture file with
.env
contents - We start a new process with
Popen
to lint this fixture withdotenv-linter
command - We check the outputs
Example: https://github.com/wemake-services/wemake-python-styleguide/blob/master/tests/test_plugins.py