Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/959169 )

Change subject: [tests] Don't cover code with Python 3.13
......................................................................

[tests] Don't cover code with Python 3.13

coverage package does not work for Pythom 3.13. Therefore ignore
coverage in that case.

Bug: T346862
Change-Id: I1de5ce9709a652cecc3bf26e19c20ebbabe26430
---
M .github/workflows/doctest.yml
M .github/workflows/write_tests-ci.yml
M .github/workflows/oauth_tests-ci.yml
M .github/workflows/pywikibot-ci.yml
M .github/workflows/login_tests-ci.yml
5 files changed, 76 insertions(+), 5 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved




diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml
index d9d04b2..80c3438 100644
--- a/.github/workflows/doctest.yml
+++ b/.github/workflows/doctest.yml
@@ -72,14 +72,24 @@
       run: |
         python -Werror::UserWarning -m pwb generate_user_files 
-site:wikipedia:test -user:${{ env.PYWIKIBOT_USERNAME }} -v -debug;

-    - name: doctest with pytest
+    - name: doctest with pytest and coverage
+      if: ${{ matrix.python-version != '3.13-dev' }}
       timeout-minutes: 5
       run: |
         python pwb.py version
         pytest --version
         coverage run -m pytest pywikibot --doctest-modules 
--ignore-glob="*gui.py" --ignore-glob="*memento.py"

+    - name: doctest with pytest without coverage due to T346862
+      if: ${{ matrix.python-version == '3.13-dev' }}
+      timeout-minutes: 5
+      run: |
+        python pwb.py version
+        pytest --version
+        pytest pywikibot --doctest-modules --ignore-glob="*gui.py" 
--ignore-glob="*memento.py"
+
     - name: Show coverage statistics
+      if: ${{ matrix.python-version != '3.13-dev' }}
       run: |
         coverage report

diff --git a/.github/workflows/login_tests-ci.yml 
b/.github/workflows/login_tests-ci.yml
index 13b87e5..caad57d 100644
--- a/.github/workflows/login_tests-ci.yml
+++ b/.github/workflows/login_tests-ci.yml
@@ -123,13 +123,22 @@
         echo "password_file = os.path.expanduser('passwordfile')" >> 
user-config.py
         echo "('${{ env.PYWIKIBOT_USERNAME }}', '${{ secrets.PYWIKIBOT_USERPWD 
}}')" > passwordfile

-    - name: Test with unittest
+    - name: Test with unittest and coverage
+      if: ${{ matrix.python-version != '3.13-dev' }}
       timeout-minutes: 2
       run: |
         python pwb.py version
         coverage run -m unittest -vv tests/site_login_logout_tests.py

+    - name: Test with unittest without coverage due to T346862
+      if: ${{ matrix.python-version == '3.13-dev' }}
+      timeout-minutes: 2
+      run: |
+        python pwb.py version
+        unittest -vv tests/site_login_logout_tests.py
+
     - name: Show coverage statistics
+      if: ${{ matrix.python-version != '3.13-dev' }}
       run: |
         coverage report

diff --git a/.github/workflows/oauth_tests-ci.yml 
b/.github/workflows/oauth_tests-ci.yml
index 602bd4a..e8baec1 100644
--- a/.github/workflows/oauth_tests-ci.yml
+++ b/.github/workflows/oauth_tests-ci.yml
@@ -108,7 +108,8 @@
         echo "maximum_GET_length = 5000" >> user-config.py
         echo "console_encoding = 'utf8'" >> user-config.py

-    - name: Test with unittest
+    - name: Oauth tests with unittest and coverage
+      if: ${{ matrix.python-version != '3.13-dev' }}
       timeout-minutes: 2
       env:
         PYWIKIBOT_TEST_OAUTH: ${{ secrets[format('{0}', 
steps.token.outputs.uppercase)] }}
@@ -116,7 +117,17 @@
         python pwb.py version
         coverage run -m unittest -vv tests/oauth_tests.py

+    - name: Oauth test with unittest without coverage due to T346862
+      if: ${{ matrix.python-version == '3.13-dev' }}
+      timeout-minutes: 2
+      env:
+        PYWIKIBOT_TEST_OAUTH: ${{ secrets[format('{0}', 
steps.token.outputs.uppercase)] }}
+      run: |
+        python pwb.py version
+        unittest -vv tests/oauth_tests.py
+
     - name: Show coverage statistics
+      if: ${{ matrix.python-version != '3.13-dev' }}
       run: |
         coverage report

diff --git a/.github/workflows/pywikibot-ci.yml 
b/.github/workflows/pywikibot-ci.yml
index 5466d4f..0442e81 100644
--- a/.github/workflows/pywikibot-ci.yml
+++ b/.github/workflows/pywikibot-ci.yml
@@ -137,7 +137,8 @@
         echo "password_file = os.path.expanduser('passwordfile')" >> 
user-config.py
         echo "('${{ env.PYWIKIBOT_USERNAME }}', '${{ secrets.PYWIKIBOT_USERPWD 
}}')" > passwordfile

-    - name: Test with unittest or pytest
+    - name: Test with unittest or pytest and coverage
+      if: ${{ matrix.python-version != '3.13-dev' }}
       id: ci_test
       continue-on-error: true
       timeout-minutes: 90
@@ -153,7 +154,21 @@
           pytest --cov=.;
         fi

+    - name: Test with unittest without coverage due to T346862
+      if: ${{ matrix.python-version == '3.13-dev' }}
+      id: ci_test
+      continue-on-error: true
+      timeout-minutes: 90
+      env:
+        PYWIKIBOT_TEST_NO_RC:
+          ${{ (matrix.site == 'wikisource:zh' || matrix.test_no_rc) && 1 || 0 
}}
+        PYWIKIBOT_TEST_PROD_ONLY: ${{ matrix.test_prod_only && 1 || 0 }}
+      run: |
+        python pwb.py version
+        unittest discover -vv -p \"*_tests.py\";
+
     - name: Show coverage statistics
+      if: ${{ matrix.python-version != '3.13-dev' }}
       run: |
         coverage report

diff --git a/.github/workflows/write_tests-ci.yml 
b/.github/workflows/write_tests-ci.yml
index f5d80c2..582ee6f 100644
--- a/.github/workflows/write_tests-ci.yml
+++ b/.github/workflows/write_tests-ci.yml
@@ -65,7 +65,8 @@
         echo "password_file = os.path.expanduser('passwordfile')" >> 
user-config.py
         echo "('${{ env.PYWIKIBOT_USERNAME }}', '${{ secrets.PYWIKIBOT_USERPWD 
}}')" > passwordfile

-    - name: Test with pytest
+    - name: Write test with pytest and coverage
+      if: ${{ matrix.python-version != '3.13-dev' }}
       id: ci_test
       continue-on-error: true
       timeout-minutes: 90
@@ -75,7 +76,19 @@
         python pwb.py version
         pytest -a write --cov=.;

+    - name: Write test with pytest without coverage due to T346862
+      if: ${{ matrix.python-version == '3.13-dev' }}
+      id: ci_test
+      continue-on-error: true
+      timeout-minutes: 90
+      env:
+        PYWIKIBOT_TEST_WRITE: ${{ matrix.site == 'wikipedia:test' && 1 || 0}}
+      run: |
+        python pwb.py version
+        pytest -a write
+
     - name: Show coverage statistics
+      if: ${{ matrix.python-version != '3.13-dev' }}
       run: |
         coverage report


--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/959169
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I1de5ce9709a652cecc3bf26e19c20ebbabe26430
Gerrit-Change-Number: 959169
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to