From dd4c49ab9e1fbf0914789b460e157dd609dd5390 Mon Sep 17 00:00:00 2001 From: NamazovMaksim Date: Wed, 2 Sep 2026 16:31:22 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20checks.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/checks.yml | 5 ++++- tests/test_routes/test_lecturer.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 233ac3c1..e8d329c9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -29,13 +29,16 @@ jobs: run: | DB_DSN=postgresql://postgres@localhost:5432/postgres alembic upgrade head - name: Build coverage file + id: pytest run: | DB_DSN=postgresql://postgres@localhost:5432/postgres pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=rating_api tests/ | tee pytest-coverage.txt + exit ${PIPESTATUS[0]} - name: Print report if: always() run: | cat pytest-coverage.txt - name: Pytest coverage comment + if: always() uses: MishaKav/pytest-coverage-comment@main with: pytest-coverage-path: ./pytest-coverage.txt @@ -50,7 +53,7 @@ jobs: junitxml-path: ./pytest.xml junitxml-title: Summary - name: Fail on pytest errors - if: steps.pytest.outcome == 'failure' + if: failure() && steps.pytest.outcome == 'failure' run: exit 1 linting: runs-on: ubuntu-latest diff --git a/tests/test_routes/test_lecturer.py b/tests/test_routes/test_lecturer.py index 45d545cc..a0bf9900 100644 --- a/tests/test_routes/test_lecturer.py +++ b/tests/test_routes/test_lecturer.py @@ -16,6 +16,7 @@ @pytest.mark.parametrize('response_status', [status.HTTP_200_OK, status.HTTP_409_CONFLICT]) def test_create_lecturer(client, dbsession, response_status): + assert False body = {"first_name": 'Иван', "last_name": 'Иванов', "middle_name": 'Иванович', "timetable_id": 0} post_response = client.post(url, json=body) assert post_response.status_code == response_status From 6ab7157a38d2b5d45117259406e9a4166bdfb8ce Mon Sep 17 00:00:00 2001 From: NamazovMaksim Date: Wed, 2 Sep 2026 18:09:06 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=9F=D0=BE=D1=87=D0=B8=D0=BD=D0=BA=D0=B0?= =?UTF-8?q?=20=D1=88=D0=B0=D0=B3=D0=B0=20Fail=20on=20pytest=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_routes/test_lecturer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_routes/test_lecturer.py b/tests/test_routes/test_lecturer.py index a0bf9900..45d545cc 100644 --- a/tests/test_routes/test_lecturer.py +++ b/tests/test_routes/test_lecturer.py @@ -16,7 +16,6 @@ @pytest.mark.parametrize('response_status', [status.HTTP_200_OK, status.HTTP_409_CONFLICT]) def test_create_lecturer(client, dbsession, response_status): - assert False body = {"first_name": 'Иван', "last_name": 'Иванов', "middle_name": 'Иванович', "timetable_id": 0} post_response = client.post(url, json=body) assert post_response.status_code == response_status