Skip to content

Commit

Permalink
Add tox file
Browse files Browse the repository at this point in the history
This is the defacto way to run unit tests for most Python projects. The
tox-poetry extension is used to provide integration with poetry.

Signed-off-by: Stephen Finucane <stephen@that.guru>
  • Loading branch information
stephenfin committed Oct 14, 2022
1 parent a817d21 commit 3c79042
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get full Python version
id: full-python-version
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
entry: flynt
language: python
additional_dependencies: ['flynt==0.64']

- id: black
name: black
entry: black
Expand Down
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[tox]
minversion = 3.18.0
requires = tox-poetry

[testenv]
commands = pytest {posargs:tests/}

[testenv:lint]
allowlist_externals = poetry
commands = poetry run pre-commit run -a

0 comments on commit 3c79042

Please sign in to comment.