From 664577a515827207305e7e7d4c66e9d800223afa Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Fri, 2 Jun 2023 12:18:29 +0300 Subject: [PATCH 1/6] Add tox.ini to easily test multiple Python versions --- .github/workflows/ci.yml | 5 +++-- tox.ini | 13 +++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tox.ini diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c08a86a..1ed9973 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,16 +26,17 @@ jobs: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: | + .github/workflows/ci.yml dev-requirements.txt requirements.txt - name: Install dependencies run: | - python3 -m pip install -U -r dev-requirements.txt + python3 -m pip install -U coverage tox - name: Tests run: | - python3 -m coverage run --branch -m pytest tests/ + tox -e py python3 -m coverage report python3 -m coverage xml diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..f5defd7 --- /dev/null +++ b/tox.ini @@ -0,0 +1,13 @@ +[tox] +requires = + tox>=4.2 +env_list = + py{311, 310, 39, 38} + +[testenv] +pass_env = + FORCE_COLOR +commands_pre = + {envpython} -m pip install -U -r dev-requirements.txt +commands = + {envpython} -m coverage run --branch -m pytest tests/ {posargs} From 931a10e5dc885322ef7008349e8c63cac00444bf Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 22 Aug 2023 11:22:42 +0300 Subject: [PATCH 2/6] Call pytest to measure/report coverage of all module and test code --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index f5defd7..cf73210 100644 --- a/tox.ini +++ b/tox.ini @@ -10,4 +10,4 @@ pass_env = commands_pre = {envpython} -m pip install -U -r dev-requirements.txt commands = - {envpython} -m coverage run --branch -m pytest tests/ {posargs} + {envpython} -m pytest --cov blurb_it --cov tests --cov-branch --cov-report html --cov-report term --cov-report xml {posargs} From 7c1c8927f13832fb302919eb5f5876d726e2ea6e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 9 Oct 2023 10:40:44 +0200 Subject: [PATCH 3/6] Add 3.12 to tox.ini --- .github/workflows/ci.yml | 2 -- tox.ini | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2182c26..7146688 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,8 +35,6 @@ jobs: - name: Tests run: | tox -e py - python3 -m coverage report - python3 -m coverage xml - name: Upload coverage uses: codecov/codecov-action@v3 diff --git a/tox.ini b/tox.ini index cf73210..859198c 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ requires = tox>=4.2 env_list = - py{311, 310, 39, 38} + py{312, 311, 310, 39, 38} [testenv] pass_env = From c248963aa95d5e2e14de4e2c046a04532be601a0 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 9 Oct 2023 10:43:27 +0200 Subject: [PATCH 4/6] Remove --cov-branch, it's in config --- tox.ini | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 859198c..c9a5d6a 100644 --- a/tox.ini +++ b/tox.ini @@ -10,4 +10,10 @@ pass_env = commands_pre = {envpython} -m pip install -U -r dev-requirements.txt commands = - {envpython} -m pytest --cov blurb_it --cov tests --cov-branch --cov-report html --cov-report term --cov-report xml {posargs} + {envpython} -m pytest \ + --cov blurb_it \ + --cov tests \ + --cov-report html \ + --cov-report term \ + --cov-report xml \ + {posargs} From 7bdfafd176f79fc95607319a17b6ceffe3df8904 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 9 Oct 2023 11:40:20 +0200 Subject: [PATCH 5/6] Move config to pytest.ini so always used --- pytest.ini | 9 ++++++++- tox.ini | 5 ----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pytest.ini b/pytest.ini index 932b2fb..ee3bbae 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,12 @@ [pytest] -addopts = --strict-config --strict-markers +addopts = + --strict-config + --strict-markers + --cov blurb_it + --cov tests + --cov-report html + --cov-report term + --cov-report xml xfail_strict = True asyncio_mode = auto filterwarnings = error diff --git a/tox.ini b/tox.ini index c9a5d6a..de9d6ec 100644 --- a/tox.ini +++ b/tox.ini @@ -11,9 +11,4 @@ commands_pre = {envpython} -m pip install -U -r dev-requirements.txt commands = {envpython} -m pytest \ - --cov blurb_it \ - --cov tests \ - --cov-report html \ - --cov-report term \ - --cov-report xml \ {posargs} From 7a81f4e57bf25eca06ca573c65bedad9e3fd6dfe Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 9 Oct 2023 04:02:03 -0600 Subject: [PATCH 6/6] One line Co-authored-by: Alex Waygood --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index de9d6ec..bb4c614 100644 --- a/tox.ini +++ b/tox.ini @@ -10,5 +10,4 @@ pass_env = commands_pre = {envpython} -m pip install -U -r dev-requirements.txt commands = - {envpython} -m pytest \ - {posargs} + {envpython} -m pytest {posargs}