diff options
author | Victor Stinner <vstinner@python.org> | 2020-10-05 16:24:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-05 16:24:00 (GMT) |
commit | 1fce240d6c4b2b2cc17a86e88c65169e15b9feeb (patch) | |
tree | 8aa55b35eb5175fda7c9898f1e5000c2ed29b970 /Lib/test | |
parent | 060937da988347a887a5f165b023d972fcb97802 (diff) | |
download | cpython-1fce240d6c4b2b2cc17a86e88c65169e15b9feeb.zip cpython-1fce240d6c4b2b2cc17a86e88c65169e15b9feeb.tar.gz cpython-1fce240d6c4b2b2cc17a86e88c65169e15b9feeb.tar.bz2 |
bpo-41939: Fix test_site.test_license_exists_at_url() (#22559)
Call urllib.request.urlcleanup() to reset the global
urllib.request._opener.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_site.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index d3ee68f..a475ed1 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -525,6 +525,8 @@ class ImportSideEffectTests(unittest.TestCase): # string displayed by license in the absence of a LICENSE file. url = license._Printer__data.split()[1] req = urllib.request.Request(url, method='HEAD') + # Reset global urllib.request._opener + self.addCleanup(urllib.request.urlcleanup) try: with socket_helper.transient_internet(url): with urllib.request.urlopen(req) as data: |