Skip to content

Commit 88e4b63

Browse files
committed
Tox!
Signed-off-by: Adam Hill <[email protected]>
1 parent fff3155 commit 88e4b63

File tree

6 files changed

+35
-2
lines changed

6 files changed

+35
-2
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
__pycache__
55
.cache
66
.pytest_cache
7+
.tox
8+
.eggs
9+
*.egg-info
10+
711

812
# Created by https://www.gitignore.io/api/jetbrains+iml
913

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ install:
99

1010
script:
1111
# run tasks marked as 'build_stage' first (ensure docker images are built)
12-
- py.test -vv -n auto -m "build_stage"
1312
# run the remaining tasks in the test suite
14-
- py.test -vv -n auto -m "not build_stage"
13+
- tox

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ pytest
33
pytest-xdist
44
pytest-cov
55
testinfra
6+
tox

setup.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from setuptools import setup
2+
3+
setup(
4+
setup_requires=['pytest-runner'],
5+
tests_require=['pytest'],
6+
)

test/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# How do I test?
2+
3+
Make sure you have Docker and Python w/pip package manager.
4+
5+
From command line all you need to do is:
6+
7+
- `pip install tox`
8+
- `tox`
9+
10+
# How do I debug python?
11+
12+
Highly recommended: Setup PyCharm on a **Docker enabled** machine. Having a python debugger like PyCharm changes your life if you've never used it :)
13+

tox.ini

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[tox]
2+
envlist = py27
3+
4+
[testenv]
5+
whitelist_externals = docker
6+
deps = -rrequirements.txt
7+
commands = docker build -f test/debian.Dockerfile -t pytest_pihole:debian .
8+
docker build -f test/centos.Dockerfile -t pytest_pihole:centos .
9+
docker build -f test/fedora.Dockerfile -t pytest_pihole:fedora .
10+
pytest {posargs:-vv -n auto} -m "not build_stage" ./test/

0 commit comments

Comments
 (0)