move pytest.ini into pyproject.toml

pull/20/head
JensDiemer 2020-11-13 22:45:40 +01:00
rodzic 45f53541a9
commit c4c63d8e18
2 zmienionych plików z 33 dodań i 47 usunięć

Wyświetl plik

@ -88,11 +88,44 @@ publish = "inventory_project.publish:publish"
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
[tool.autopep8]
# https://github.com/hhatto/autopep8#pyprojecttoml
max_line_length = 120
exclude = "*/migrations/*"
[tool.pytest.ini_options]
# https://docs.pytest.org/en/latest/customize.html#pyproject-toml
minversion = "6.0"
DJANGO_SETTINGS_MODULE="inventory_project.settings.tests"
norecursedirs = ".* .git __pycache__ coverage* dist"
# sometimes helpfull "addopts" arguments:
# -vv
# --verbose
# --capture=no
# --trace-config
# --full-trace
# -p no:warnings
addopts = """
--import-mode=importlib
--ignore-glob=deployment/inventory/*
--reuse-db
--nomigrations
--cov=.
--cov-report term-missing
--cov-report html
--cov-report xml
--no-cov-on-fail
--showlocals
--doctest-modules
--failed-first
--last-failed-no-failures all
--new-first
-p no:randomly
"""
[tool.tox]
# https://tox.readthedocs.io/en/latest/example/basic.html#pyproject-toml-tox-legacy-ini
legacy_tox_ini = """

Wyświetl plik

@ -1,47 +0,0 @@
#
# http://doc.pytest.org/en/latest/customize.html#builtin-configuration-file-options
# https://pytest-django.readthedocs.io/en/latest/
[pytest]
DJANGO_SETTINGS_MODULE=inventory_project.settings.tests
# http://doc.pytest.org/en/latest/customize.html#confval-norecursedirs
norecursedirs = .* .git __pycache__ coverage* dist
addopts =
--import-mode=importlib
--ignore-glob=deployment/inventory/*
--collect-in-virtualenv
--reuse-db
--nomigrations
# coverage:
--cov=.
--cov-report term-missing
--cov-report html
--cov-report xml
--no-cov-on-fail
--showlocals
--doctest-modules
# run the last failures first:
--failed-first
# run all tests if no tests failed in the last run:
--last-failed-no-failures all
# sort new tests first:
--new-first
# randomly is sometimes helpfull, comment this:
-p no:randomly
# sometimes helpfull:
#-vv
#--verbose
#--capture=no
#--trace-config
#--full-trace
#-p no:warnings