From c4c63d8e183d241b9a1e9a06579b6a5310b367e5 Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Fri, 13 Nov 2020 22:45:40 +0100 Subject: [PATCH] move pytest.ini into pyproject.toml --- pyproject.toml | 33 +++++++++++++++++++++++++++++++++ pytest.ini | 47 ----------------------------------------------- 2 files changed, 33 insertions(+), 47 deletions(-) delete mode 100644 pytest.ini diff --git a/pyproject.toml b/pyproject.toml index ef983b0..62157b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = """ diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 5679270..0000000 --- a/pytest.ini +++ /dev/null @@ -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