Skip to content

Commit 3c79042

Browse files
committed
Add tox file
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 <[email protected]>
1 parent a817d21 commit 3c79042

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.github/workflows/python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/setup-python@v2
2424
with:
2525
python-version: ${{ matrix.python-version }}
26-
26+
2727
- name: Get full Python version
2828
id: full-python-version
2929
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
entry: flynt
2323
language: python
2424
additional_dependencies: ['flynt==0.64']
25-
25+
2626
- id: black
2727
name: black
2828
entry: black

tox.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[tox]
2+
minversion = 3.18.0
3+
requires = tox-poetry
4+
5+
[testenv]
6+
commands = pytest {posargs:tests/}
7+
8+
[testenv:lint]
9+
allowlist_externals = poetry
10+
commands = poetry run pre-commit run -a

0 commit comments

Comments
 (0)