jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1343578?usp=email )

Change subject: tests: exclude eventstreams.py from doctests run
......................................................................

tests: exclude eventstreams.py from doctests run

The eventstreams.py doctest already skips the output of the received
event with print(msg) and pprint(change, width=75, indent=1).
Therefore, reading the next event with change = next(stream) does not
provide any meaningful test coverage.

With a high maxlag, bot edits may stop and no new events may be
received for several minutes, causing the doctest to time out.

Bug: T438621
Change-Id: I8e3071dcf887cc348b4a7ec47570bdb20c397ce8
---
M .github/workflows/doctest.yml
M pywikibot/comms/eventstreams.py
M tox.ini
3 files changed, 10 insertions(+), 5 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  Mahveotm: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml
index ae1b100..fa50c72 100644
--- a/.github/workflows/doctest.yml
+++ b/.github/workflows/doctest.yml
@@ -80,7 +80,12 @@
         run: |
           python pwb.py version
           pytest --version
-          coverage run -m pytest pywikibot --doctest-modules 
--ignore-glob="*gui.py" --ignore-glob="*memento.py" --doctest-wait
+          coverage run -m pytest pywikibot \
+            --doctest-modules \
+            --ignore-glob=*eventstreams.py \
+            --ignore-glob="*gui.py" \
+            --ignore-glob="*memento.py" \
+            --doctest-wait
       - name: Close WMCS SOCKS tunnel
         if: always()
         shell: bash
diff --git a/pywikibot/comms/eventstreams.py b/pywikibot/comms/eventstreams.py
index 401dfac..26533c2 100644
--- a/pywikibot/comms/eventstreams.py
+++ b/pywikibot/comms/eventstreams.py
@@ -58,10 +58,10 @@
     >>> stream.register_filter(type='edit', wiki='wikidatawiki', bot=True)
     >>> change = next(stream)
     >>> msg = '{type} on page {title} by {user}.'.format_map(change)
-    >>> print(msg)  # doctest: +SKIP
+    >>> print(msg)
     edit on page Q2190037 by KrBot.
     >>> from pprint import pprint
-    >>> pprint(change, width=75, indent=1)  # doctest: +SKIP
+    >>> pprint(change, width=75, indent=1)
     {'$schema': '/mediawiki/recentchange/1.0.0',
      'bot': True,
      'comment': '/* wbsetreference-set:2| */ [[Property:P10585]]: 96FPN, см. '
diff --git a/tox.ini b/tox.ini
index 38025dd..a57aae8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,8 +10,8 @@
 # Note: tox 4 does not support multiple lines when doing parameters
 # substitution.
 generate_user_files = -W error::UserWarning -m pwb generate_user_files 
-site:wikipedia:test -v
-# ignores: gui.py (needs tkinter), memento.py (has too many timeouts)
-DOCTEST_IGNORES = --ignore-glob=*gui.py --ignore-glob=*memento.py
+# ignores: eventstreams.py (can't test data), gui.py (needs tkinter), 
memento.py (has too many timeouts)
+DOCTEST_IGNORES = --ignore-glob=*eventstreams.py --ignore-glob=*gui.py 
--ignore-glob=*memento.py
 MAXLAG = -c "with open('user-config.py','a') as f: f.write('\nmaxlag = 90\n')"

 [testenv]

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

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8e3071dcf887cc348b4a7ec47570bdb20c397ce8
Gerrit-Change-Number: 1343578
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Mahveotm <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to