This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make test_unicodedata pass when running without network
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.10
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: Jim.Jewett, yan12125
Priority: normal Keywords: patch

Created on 2020-07-25 10:26 by yan12125, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 21615 closed yan12125, 2020-07-25 10:38
Messages (3)
msg374249 - (view) Author: (yan12125) * Date: 2020-07-25 10:26
I setup a buildbot worker to test Python 3.x on Android monthly. This month network in the Android emulator is broken and I got an additional test failure:

0:05:28 load avg: 1.21 [376/423/11] test_unicodedata failed
test test_unicodedata failed -- Traceback (most recent call last):
  File "/data/local/tmp/lib/python3.10/urllib/request.py", line 1342, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
socket.gaierror: [Errno 7] No address associated with hostname

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/local/tmp/lib/python3.10/test/test_unicodedata.py", line 329, in test_normalization
    testdata = open_urlresource(TESTDATAURL, encoding="utf-8",
urllib.error.URLError: <urlopen error [Errno 7] No address associated with hostname>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/local/tmp/lib/python3.10/test/test_unicodedata.py", line 335, in test_normalization
    self.fail(f"Could not retrieve {TESTDATAURL}")
AssertionError: Could not retrieve http://www.pythontest.net/unicode/13.0.0/NormalizationTest.txt

I propose wrapping the test in socket_helper.transient_internet() so that this test is skipped if the Internet is not available.
msg374462 - (view) Author: Jim Jewett (Jim.Jewett) * (Python triager) Date: 2020-07-28 04:50
Looks Good To Me
msg395245 - (view) Author: (yan12125) * Date: 2021-06-07 04:38
Closing in favor of a simpler fix merged from issue43144. Thanks for the fix!
History
Date User Action Args
2022-04-11 14:59:34adminsetgithub: 85563
2021-06-07 04:38:43yan12125setstatus: open -> closed
resolution: duplicate
messages: + msg395245

stage: patch review -> resolved
2020-07-28 04:50:38Jim.Jewettsetnosy: + Jim.Jewett
messages: + msg374462
2020-07-25 10:38:12yan12125setkeywords: + patch
stage: patch review
pull_requests: + pull_request20757
2020-07-25 10:26:54yan12125create