From c247f430f77393041bf79201ce45a123d23e718d Mon Sep 17 00:00:00 2001 From: mastercaster9000 Date: Sun, 5 Mar 2023 17:00:08 +0000 Subject: [PATCH] combine pytest.ini with pyproject.toml --- .pytest.ini | 5 ----- coverage/.gitignore | 4 ++++ pyproject.toml | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) delete mode 100644 .pytest.ini create mode 100644 coverage/.gitignore diff --git a/.pytest.ini b/.pytest.ini deleted file mode 100644 index 16ccfafe80..0000000000 --- a/.pytest.ini +++ /dev/null @@ -1,5 +0,0 @@ -[pytest] -DJANGO_SETTINGS_MODULE = webtas.settings -; python_files = tests.py test_*.py *_tests.py - -addopts = --cov=. --cov-config=.coveragerc --cov-report xml:cov.xml diff --git a/coverage/.gitignore b/coverage/.gitignore new file mode 100644 index 0000000000..86d0cb2726 --- /dev/null +++ b/coverage/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ed7c6563dc..be12351a7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -142,8 +142,24 @@ version = { attr = "invokeai.version.__version__" } "invokeai.configs" = ["*.example", "**/*.yaml", "*.txt"] "invokeai.frontend.web.dist" = ["**"] +#=== Begin: PyTest and Coverage [tool.pytest.ini_options] -addopts = "-p pytest_cov --junitxml=junit/test-results.xml --cov-report=term:skip-covered --cov=ldm/invoke --cov=backend --cov-branch" +addopts = "--cov-report term --cov-report html --cov-report xml" +[tool.coverage.run] +branch = true +source = ["invokeai"] +omit = ["*tests*", "*migrations*", ".venv/*", "*.env"] +[tool.coverage.report] +show_missing = true +fail_under = 85 # let's set something sensible on Day 1 ... +[tool.coverage.json] +output = "coverage/coverage.json" +pretty_print = true +[tool.coverage.html] +directory = "coverage/html" +[tool.coverage.xml] +output = "coverage/index.xml" +#=== End: PyTest and Coverage [flake8] max-line-length = 120