Skip to content

Commit

Permalink
Add a tox file to automatically run the tests and add Python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Betts authored and un33k committed Apr 30, 2021
1 parent c340834 commit 3cc1069
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
3.9.2
3.8.8
3.7.10
3.6.13
3.5.10
2.7.18
pypy-5.7.1
pypy3.7-7.3.3
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "pypy"
- "pypy3"

install:
- pip install pip -U
- pip install -e .
- pip install pycodestyle
- pip install coveralls
# Avoid cryptography compilation problems with pypy and 2.7
- pip install coveralls 'cryptography<=3.0;python_version=="2.7"'
- pip install https://github.com/un33k/pyflakes/tarball/master

before_script:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ quick-brown-fox-jumps-over-lazy-dog
Running the tests
====================

To run the tests against all environments:

tox

To run the tests against the current environment:

python test.py
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
]


Expand Down
18 changes: 18 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tox]
envlist = py{39,38,37,36,35,27},pypy,pypy3

[testenv]
deps=
-e .
commands =
python -m unittest test

[testenv:format]
deps = pycodestyle
allowlist_externals = sh
commands = sh format.sh

[testenv:coverage]
deps = coverage
commands =
coverage run --source=slugify test.py

0 comments on commit 3cc1069

Please sign in to comment.