peterjc / flake8-black

flake8 plugin to run black for checking Python coding style
MIT License
165 stars 10 forks source link

Use tox to run the tests #35

Closed brianhelba closed 2 years ago

brianhelba commented 3 years ago

This adds Tox as a test environment runner. A major benefit of Tox is that it runs each test environment in an isolated, fresh virtualenv.

Note, this means that the lack of toml in setup.py actually causes tests to fail with Tox, since in the isolated virtualenv, no extra packages are installed (isolating your tests from the existing packages on the host system).

This also adds GitHub actions to run all tests via Tox for every PR and upon every merge to master.

Fixes #34.

brianhelba commented 3 years ago

@peterjc PTAL.

peterjc commented 2 years ago

This is going to need a proper rebase/merge after #51 which added a simpler GA setup (with a different YAML filename), to focus on the tox work.

peterjc commented 2 years ago

Hmm. Not sure why this should be failing via tox (happens locally on macOS too):

$ restructuredtext-lint '*.rst'
Path "*.rst" not found as a file nor directory

Also flake8 doesn't like some of the more recent examples like the syntax error in ./tests/test_cases/no_closing_bracket.py resulting in a special case with 420c3ce3a19bd1e311cb9bccf08e40071b0f7649

Might be easier to remove the linting from tox, and leave that to pre-commit instead.

peterjc commented 2 years ago

I've not felt the need to run my tests via tox lately, so on balance I think I will close this after all. But thank you Brian for the suggestion - and the nudge on using GitHub Actions.