From a954532ed9cb65443d33546ca4cb3f55b3974698 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 18 Oct 2023 20:38:58 +0200 Subject: [PATCH 1/5] DRAFT: GitHub Action to run pytest Related to #332 --- .github/workflows/pytest.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 00000000..d0e9f328 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,13 @@ +name: pytest +on: [pull_request, push] +jobs: + pytest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: {python-version: 3.x} + - run: pip install pytest + - run: pip install -r requirements.txt || pip install --editable . || pip install . || true + - run: pytest . + - run: pytest --doctest-modules . || true From c52cbff7de468d6cb186bf871d6ac0972e2eede3 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 18 Oct 2023 22:57:35 +0200 Subject: [PATCH 2/5] pip install pytest testscenarios --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d0e9f328..e056332f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -7,7 +7,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: {python-version: 3.x} - - run: pip install pytest + - run: pip install pytest testscenarios - run: pip install -r requirements.txt || pip install --editable . || pip install . || true - run: pytest . - run: pytest --doctest-modules . || true From 21da7eabfe47c41bd2f91e07ea491c40a04c2ef2 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 18 Oct 2023 23:48:10 +0200 Subject: [PATCH 3/5] Update pytest.yml --- .github/workflows/pytest.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e056332f..f6a7fd26 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -7,7 +7,26 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: {python-version: 3.x} - - run: pip install pytest testscenarios + - run: pip install pytest testscenarios # git+https://github.com/testing-cabal/testscenarios.git@master - run: pip install -r requirements.txt || pip install --editable . || pip install . || true - - run: pytest . + - run: pytest + --ignore=testtools/tests/test_testcase.py + --ignore=testtools/tests/matchers/test_basic.py + --ignore=testtools/tests/matchers/test_const.py + --ignore=testtools/tests/matchers/test_datastructures.py + --ignore=testtools/tests/matchers/test_dict.py + --ignore=testtools/tests/matchers/test_doctest.py + --ignore=testtools/tests/matchers/test_exception.py + --ignore=testtools/tests/matchers/test_higherorder.py + --ignore=testtools/tests/matchers/test_warnings.py . + - run: pytest + testtools/tests/test_testcase.py + testtools/tests/matchers/test_basic.py + testtools/tests/matchers/test_const.py + testtools/tests/matchers/test_datastructures.py + testtools/tests/matchers/test_dict.py + testtools/tests/matchers/test_doctest.py + testtools/tests/matchers/test_exception.py + testtools/tests/matchers/test_higherorder.py + testtools/tests/matchers/test_warnings.py - run: pytest --doctest-modules . || true From 118ad64910db97a556c4f4a8e1362e01b6838ab8 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 18 Oct 2023 23:56:35 +0200 Subject: [PATCH 4/5] Update pytest.yml --- .github/workflows/pytest.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f6a7fd26..50e5c8be 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -7,10 +7,10 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: {python-version: 3.x} - - run: pip install pytest testscenarios # git+https://github.com/testing-cabal/testscenarios.git@master + - run: pip install pytest testscenarios + # git+https://github.com/testing-cabal/testscenarios.git@master - run: pip install -r requirements.txt || pip install --editable . || pip install . || true - run: pytest - --ignore=testtools/tests/test_testcase.py --ignore=testtools/tests/matchers/test_basic.py --ignore=testtools/tests/matchers/test_const.py --ignore=testtools/tests/matchers/test_datastructures.py @@ -18,9 +18,10 @@ jobs: --ignore=testtools/tests/matchers/test_doctest.py --ignore=testtools/tests/matchers/test_exception.py --ignore=testtools/tests/matchers/test_higherorder.py - --ignore=testtools/tests/matchers/test_warnings.py . + --ignore=testtools/tests/matchers/test_warnings.py + --ignore=testtools/tests/test_testcase.py + --ignore=testtools/tests/test_testresult.py . - run: pytest - testtools/tests/test_testcase.py testtools/tests/matchers/test_basic.py testtools/tests/matchers/test_const.py testtools/tests/matchers/test_datastructures.py @@ -29,4 +30,6 @@ jobs: testtools/tests/matchers/test_exception.py testtools/tests/matchers/test_higherorder.py testtools/tests/matchers/test_warnings.py + testtools/tests/test_testcase.py + testtools/tests/test_testresult.py . || true - run: pytest --doctest-modules . || true From ae4d838940495c10fab67574ecdda1149f17e28b Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 19 Oct 2023 00:11:34 +0200 Subject: [PATCH 5/5] Update pytest.yml --- .github/workflows/pytest.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 50e5c8be..f385f327 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,7 +10,8 @@ jobs: - run: pip install pytest testscenarios # git+https://github.com/testing-cabal/testscenarios.git@master - run: pip install -r requirements.txt || pip install --editable . || pip install . || true - - run: pytest + - name: Pytests that pass + run: pytest --ignore=testtools/tests/matchers/test_basic.py --ignore=testtools/tests/matchers/test_const.py --ignore=testtools/tests/matchers/test_datastructures.py @@ -21,7 +22,9 @@ jobs: --ignore=testtools/tests/matchers/test_warnings.py --ignore=testtools/tests/test_testcase.py --ignore=testtools/tests/test_testresult.py . - - run: pytest + # TODO: Fix the pytests that fail and move them up + - name: Pytests that fail + run: pytest testtools/tests/matchers/test_basic.py testtools/tests/matchers/test_const.py testtools/tests/matchers/test_datastructures.py @@ -31,5 +34,5 @@ jobs: testtools/tests/matchers/test_higherorder.py testtools/tests/matchers/test_warnings.py testtools/tests/test_testcase.py - testtools/tests/test_testresult.py . || true + testtools/tests/test_testresult.py || true - run: pytest --doctest-modules . || true