summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Willhaus <mail@janwillhaus.de>2019-05-15 21:59:22 +0200
committerJan Willhaus <mail@janwillhaus.de>2019-05-18 19:27:25 +0200
commita8535d5d9e7896ebc4d5ca6276f27bc8279d975a (patch)
treed6bffbdf321f36a1322c9c5033be12e06be3188d
parente5e16728bba97f0b84830765b8fb3340059f305e (diff)
downloadwarlock-a8535d5d9e7896ebc4d5ca6276f27bc8279d975a.tar.gz
Update CI testing environment
-rw-r--r--.coveragerc19
-rw-r--r--.gitignore5
-rw-r--r--.travis.yml46
-rw-r--r--pytest.ini9
-rw-r--r--test/__init__.py0
5 files changed, 69 insertions, 10 deletions
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000..1b53185
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,19 @@
+[run]
+source =
+ warlock
+omit =
+ test/*
+ venv/*
+
+[report]
+# Regexes for lines to exclude from consideration
+exclude_lines =
+ # Have to re-enable the standard pragma
+ pragma: no cover
+
+ # Don't complain if tests don't hit defensive assertion code:
+ raise AssertionError
+ raise NotImplementedError
+
+ # Don't complain if non-runnable code isn't run:
+ if __name__ == .__main__.: \ No newline at end of file
diff --git a/.gitignore b/.gitignore
index cce7553..68f4009 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,8 @@ warlock.egg-info/
.tox/
*.swp
*.pyc
+.coverage
+.pytest_cache/
+.python-version
+htmlcov/
+.vscode/ \ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index f962cc2..080ccdb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,15 +1,41 @@
dist: xenial
language: python
+python: 3.7
cache: pip
-python:
- - "2.7"
- - "3.4"
- - "3.5"
- - "3.6"
- - "3.7"
+
+env:
+- TEST_CMD="pytest"
+
install:
-- "pip install --upgrade pytest flake8"
+ - pip install pytest pytest-cov
+ - if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]] && [[ "$TEST_CMD" == pytest* ]]; then
+ pip install pytest pytest-cov coveralls; fi
+ - if [[ $TEST_CMD == black* ]]; then pip install black; fi
+ - if [[ $TEST_CMD == flake8* ]]; then pip install flake8 flake8-bugbear flake8-todo; fi
+ - pip install -r requirements.txt
+
script:
-- "python setup.py develop"
-- "flake8"
-- "py.test"
+- $TEST_CMD
+
+after_success:
+ - if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]] && [[ "$TEST_CMD" == pytest* ]];
+ then coveralls; fi
+
+matrix:
+ include:
+ - name: "black"
+ env:
+ - TEST_CMD="black --check --verbose ."
+ - name: "flake8"
+ env:
+ - TEST_CMD="flake8 warlock"
+ - name: "pytest-py2.7"
+ python: 2.7
+ - name: "pytest-py3.4"
+ python: 3.4
+ - name: "pytest-py3.5"
+ python: 3.5
+ - name: "pytest-py3.6"
+ python: 3.6
+ - name: "pytest-py3.7"
+ python: 3.7 \ No newline at end of file
diff --git a/pytest.ini b/pytest.ini
new file mode 100644
index 0000000..1231a44
--- /dev/null
+++ b/pytest.ini
@@ -0,0 +1,9 @@
+[pytest]
+testpaths = test
+norecursedirs = .git venv __pycache__
+addopts =
+ --cov
+ --cov-config=.coveragerc
+ --cov-report html
+ --cov-report term
+ --verbose \ No newline at end of file
diff --git a/test/__init__.py b/test/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/__init__.py