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

Change subject: [tests] Add doctests to gh action and add results to coverage
......................................................................

[tests] Add doctests to gh action and add results to coverage

Note:
- doctests does not work on windows-latest
- doctests does not work with pypy3 except for ubuntu-latest
- nose does not work with Python 3.10

Change-Id: Iad75d87af7a3e09a038c4e29c0757c393873345e
---
A .github/workflows/doctest.yml
M tox.ini
2 files changed, 66 insertions(+), 1 deletion(-)

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



diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml
new file mode 100644
index 0000000..045fc7e
--- /dev/null
+++ b/.github/workflows/doctest.yml
@@ -0,0 +1,66 @@
+# This workflow will install Python dependencies, run Pywikibot tests
+# with a variety of Python versions. For more information see:
+# 
https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
+
+name: Doctest CI
+
+on:
+  push:
+    branches: [ master ]
+
+
+env:
+  PYWIKIBOT_TEST_RUNNING: 1
+  PYWIKIBOT_USERNAME: Pywikibot-test
+
+jobs:
+  build:
+    runs-on: ${{ matrix.os }}
+    timeout-minutes: 2
+
+    strategy:
+      fail-fast: false
+      max-parallel: 3
+
+      matrix:
+        python-version: ["3.6", "3.9"]
+        os: [ "ubuntu-latest", "macOS-latest" ]
+        include:
+          - python-version: "pypy3"
+            os: "ubuntu-latest"
+
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        submodules: true
+
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip --version
+        pip install -U setuptools
+        pip install nose
+        pip install "sseclient<0.0.23,>=0.0.18"
+        pip install "mwparserfromhell>=0.5.0"
+        pip install "PyMySQL >= 0.9.3"
+        pip install codecov
+        pip install "coverage>=5.2.1"
+        python -c "import setuptools; print('setuptools:', 
setuptools.__version__)"
+
+    - name: Generate user files
+      run: |
+        python -Werror::UserWarning -m pwb generate_user_files 
-site:wikipedia:test -user:${{ env.PYWIKIBOT_USERNAME }} -v -debug;
+
+    - name: doctest with nose
+      timeout-minutes: 1
+      run: |
+        python pwb.py version
+        nosetests --version
+        nosetests -v --with-doctest --with-coverage pywikibot 
--ignore-files="(gui|memento)\.py"
+    - name: Upload coverage to Codecov
+      run: codecov
diff --git a/tox.ini b/tox.ini
index 270352e..bd09bf3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -69,7 +69,6 @@
 deps =
     nose
     .[eventstreams]
-    .[memento]
     .[mwparserfromhell]
     .[mysql]


--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/837127
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: Iad75d87af7a3e09a038c4e29c0757c393873345e
Gerrit-Change-Number: 837127
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