Skip to content

Commit

Permalink
Add tox thanks to @salah93
Browse files Browse the repository at this point in the history
  • Loading branch information
invisibleroads committed Oct 29, 2020
1 parent b142edc commit 67a5d72
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@
__pycache__
build/
dist/
.tox
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -9,6 +9,7 @@
'License :: OSI Approved :: MIT License',
]
APP_REQUIREMENTS = [
'invisibleroads-macros-security >= 1.0.1',
]
TEST_REQUIREMENTS = [
'pytest',
Expand All @@ -34,7 +35,7 @@
keywords='invisibleroads',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
zip_safe=True,
extras_require={'test': TEST_REQUIREMENTS},
install_requires=APP_REQUIREMENTS,
entry_points=ENTRY_POINTS)
2 changes: 2 additions & 0 deletions tests/test_resolutions.py
Expand Up @@ -37,6 +37,8 @@ def test_check_path():
# Do not allow linked paths that resolve outside the folder
with raises(PathValidationError):
check_path(path, B_FOLDER)
with raises(PathValidationError):
check_path(path, B_FOLDER, trusted_folders=[B_FOLDER])

# Allow linked paths if they resolve inside trusted folders
check_path(path, B_FOLDER, trusted_folders=[A_FOLDER])
39 changes: 39 additions & 0 deletions tox.ini
@@ -0,0 +1,39 @@
[coverage:run]
parallel = true
branch = true
source = invisibleroads_macros_disk

[coverage:paths]
source = invisibleroads_macros_disk,.tox/*/site-packages

[flake8]
max-line-length = 79
select = C,E,F,W,B,B950

[tox]
envlist = lint,py36,py37,py38,coverage-report

[testenv]
deps =
.[test]
commands =
coverage run -m pytest -vv tests

[testenv:coverage-report]
deps = coverage
skip_install = true
commands =
coverage combine
coverage report

[testenv:lint]
deps = flake8
skip_install = true
commands =
flake8 invisibleroads_macros_disk

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38

0 comments on commit 67a5d72

Please sign in to comment.