Skip to content

Commit

Permalink
test(pytest): set python_path directly in pytest.ini
Browse files Browse the repository at this point in the history
Previously the python_path used by pytest
was only defined in tox.ini that could be
a problem when pytest was run without tox.

This commit setup python_path directly in
the pytest configuration file.
  • Loading branch information
diodonfrost committed Nov 7, 2020
1 parent 8722edb commit 70e7b98
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[pytest]
norecursedirs = .git .* *.egg* old docs dist build
addopts = -p no:warnings
python_paths = package/
filterwarnings =
# python3.4 raises this when importing setuptools
ignore:The value of convert_charrefs will become True in 3.5.*:DeprecationWarning
Expand Down
36 changes: 17 additions & 19 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ skipsdist = True
[testenv:pytest]
basepython = python3
skip_install = true
setenv =
PYTHONPATH = package/
deps =
pytest
pytest-cov
botocore
boto3
pytest==6.1.1
pytest-cov==2.10.1
pytest-pythonpath==0.7.3
botocore==1.18.16
boto3==1.15.16
moto==1.3.14
commands =
coverage run -m pytest tests/unit --disable-pytest-warnings --cov package
Expand All @@ -21,47 +20,46 @@ commands =
basepython = python3
skip_install = true
deps =
black>=19.3b0
black==20.8b1
commands =
black package/ --line-length 79 --check

[testenv:flake8]
basepython = python3
skip_install = true
deps =
flake8
flake8-colors
flake8-docstrings>=0.2.7
# remove when https://gitlab.com/pycqa/flake8-docstrings/issues/36 is fixed
pydocstyle<4
flake8-import-order>=0.9
flake8-typing-imports>=1.1
pep8-naming
flake8==3.8.4
flake8-colors==0.1.6
flake8-docstrings==1.5.0
pydocstyle==5.1.1
flake8-import-order==0.18.1
flake8-typing-imports==1.10.0
pep8-naming==0.11.1
commands =
flake8 package/

[testenv:pylint]
basepython = python3
skip_install = true
deps =
pyflakes
pylint==2.4.4
pyflakes==2.2.0
pylint==2.6.0
commands =
pylint package/ --rcfile=tests/sanity/.pylintrc

[testenv:bandit]
basepython = python3
skip_install = true
deps =
bandit
bandit==1.6.2
commands =
bandit -r package/ -c tests/sanity/.bandit.yml

[testenv:mypy]
basepython = python3
skip_install = true
deps =
mypy
mypy==0.790
commands =
mypy --ignore-missing-imports package/

Expand Down

0 comments on commit 70e7b98

Please sign in to comment.