Page MenuHomePhabricator

test_https_cert_error method of http_tests.HttpsCertificateTestCase fails with threadfree Python
Closed, ResolvedPublic

Description

======================================================================
FAIL: test_https_cert_error (tests.http_tests.HttpsCertificateTestCase.test_https_cert_error)
Test if http.fetch respects disabled ssl certificate validation.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/pywikibot/pywikibot/tests/http_tests.py", line 118, in test_https_cert_error
    self.assertIn('InsecureRequestWarning',
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
                  [w.category.__name__ for w in warning_log])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'InsecureRequestWarning' not found in []

Probablly urllib3 or requests does not support it yet.

Event Timeline

Change #1217834 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] tests: decorate HttpsCertificateTestCase as expectedFailure if THREADING_FREE

https://gerrit.wikimedia.org/r/1217834

Change #1217834 merged by jenkins-bot:

[pywikibot/core@master] tests: decorate HttpsCertificateTestCase as expectedFailure if THREADING_FREE

https://gerrit.wikimedia.org/r/1217834

Xqt triaged this task as Medium priority.Dec 14 2025, 12:02 PM

Tests passes now with CPython (3.14.5t) and CPython (3.13.13t)

======================================================================
UNEXPECTED SUCCESS: test_https_cert_error (tests.http_tests.HttpsCertificateTestCase.test_https_cert_error)
Test if http.fetch respects disabled ssl certificate validation.
----------------------------------------------------------------------

Change #1293755 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] Revert "tests: decorate HttpsCertificateTestCase as expectedFailure if THREADING_FREE"

https://gerrit.wikimedia.org/r/1293755

Change #1293755 merged by jenkins-bot:

[pywikibot/core@master] Revert "tests: decorate HttpsCertificateTestCase as expectedFailure if THREADING_FREE"

https://gerrit.wikimedia.org/r/1293755

Xqt claimed this task.