Permalink
Browse files

add tox for flake8, doc build, coverage report, and (soon) multiple p…

…ython version testing
  • Loading branch information...
leifwalsh authored and thejunglejane committed May 19, 2018
1 parent 02effc7 commit cf47e9373e67472a72ed6e406bc3a78a1885af1a
Showing with 94 additions and 36 deletions.
  1. +13 −0 .coveragerc
  2. +2 −0 .gitignore
  3. +1 −0 Pipfile
  4. +31 −1 Pipfile.lock
  5. +2 −1 marbles/core/tests/test_main.py
  6. +6 −0 marbles/mixins/.coveragerc
  7. +0 −28 marbles/mixins/setup.cfg
  8. +4 −6 setup.cfg
  9. +35 −0 tox.ini
@@ -0,0 +1,13 @@
[html]
directory = build/coverage/html

[run]
branch = True
source =
marbles/core/marbles
marbles/mixins/marbles
omit =
*/tests/*
marbles/__init__.py
marbles/core/marbles/__init__.py
marbles/mixins/marbles/__init__.py
@@ -2,6 +2,8 @@ build/
dist/
*.egg-info/
.coverage
.coverage.*
coverage.xml
*.pyc
.eggs
.tox/
@@ -12,3 +12,4 @@ Sphinx = "*"
sphinx_rtd_theme = "*"
coverage = "*"
"flake8" = "*"
tox = "*"
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "29c03cb99fde7b6b5cd60752ccab6ecfac993594c69f4348dc24405bd5879703"
"sha256": "c7e5bcfffb3daa285571cc0d0be03b06f811a36702272ab17e4323a618820f4a"
},
"pipfile-spec": 6,
"requires": {},
@@ -302,6 +302,21 @@
],
"version": "==17.1"
},
"pluggy": {
"hashes": [
"sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff",
"sha256:d345c8fe681115900d6da8d048ba67c25df42973bda370783cd58826442dcd7c",
"sha256:e160a7fcf25762bb60efc7e171d4497ff1d8d2d75a3d0df7a21b76821ecbf5c5"
],
"version": "==0.6.0"
},
"py": {
"hashes": [
"sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881",
"sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a"
],
"version": "==1.5.3"
},
"pycodestyle": {
"hashes": [
"sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766",
@@ -386,12 +401,27 @@
],
"version": "==1.0.1"
},
"tox": {
"hashes": [
"sha256:96efa09710a3daeeb845561ebbe1497641d9cef2ee0aea30db6969058b2bda2f",
"sha256:9ee7de958a43806402a38c0d2aa07fa8553f4d2c20a15b140e9f771c2afeade0"
],
"index": "pypi",
"version": "==3.0.0"
},
"urllib3": {
"hashes": [
"sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b",
"sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f"
],
"version": "==1.22"
},
"virtualenv": {
"hashes": [
"sha256:2ce32cd126117ce2c539f0134eb89de91a8413a29baac49cbab3eb50e2026669",
"sha256:ca07b4c0b54e14a91af9f34d0919790b016923d157afda5efdde55c96718f752"
],
"version": "==16.0.0"
}
}
}
@@ -99,6 +99,7 @@ def __run_test(self):
Standard output and error produced by the test.
'''
test_dir = os.path.dirname(__file__)
core_dir = os.path.dirname(test_dir)
test_path = os.path.join(test_dir, 'examples', self.test_file)
if self.runner == 'script':
cmd = [sys.executable, test_path]
@@ -146,7 +147,7 @@ def __run_test(self):
try:
proc = subprocess.run(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
env=env)
env=env, cwd=core_dir)
finally:
if to_remove:
os.remove(to_remove)
@@ -0,0 +1,6 @@
[run]
branch = True
source = marbles
omit =
tests/*
marbles/__init__.py

This file was deleted.

Oops, something went wrong.
@@ -20,11 +20,9 @@
# IN THE SOFTWARE.
#

[coverage:html]
directory = build/coverage/html

[flake8]
# We don't care what the Sphinx configuration is doing
exclude = \
*docs/conf.py,
*.eggs
build/
docs/conf.py,
*.eggs,
.tox/
35 tox.ini
@@ -0,0 +1,35 @@
[tox]
envlist = flake8, coverage, docs, py36

[testenv]
skip_install = True
deps = pipenv
list_dependencies_command=pipenv lock -r
commands=
pipenv install
pipenv run python marbles/core/setup.py test
pipenv run python marbles/mixins/setup.py test

[testenv:flake8]
basepython = python3.6
commands=
pipenv install --dev
pipenv run python -m flake8 --version
pipenv run python -m flake8

[testenv:coverage]
basepython = python3.6
commands=
pipenv install --dev
pipenv run python -m coverage erase
pipenv run python -m coverage run marbles/core/setup.py test
pipenv run python -m coverage combine --append marbles/core .
pipenv run python -m coverage run --append marbles/mixins/setup.py test
pipenv run python -m coverage report
pipenv run python -m coverage html

[testenv:docs]
basepython = python3.6
commands=
pipenv install --dev
pipenv run python setup.py build_sphinx

0 comments on commit cf47e93

Please sign in to comment.