Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
61baebd0
Kaydet (Commit)
61baebd0
authored
Ock 25, 2012
tarafından
Nadeem Vawda
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #12804: Fix test failures on systems without internet access.
üst
a58c01ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
test_socket.py
Lib/test/test_socket.py
+6
-0
test_urllib2net.py
Lib/test/test_urllib2net.py
+7
-6
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_socket.py
Dosyayı görüntüle @
61baebd0
...
...
@@ -1168,6 +1168,12 @@ class GeneralModuleTests(unittest.TestCase):
@unittest.skipUnless
(
support
.
is_resource_enabled
(
'network'
),
'network is not enabled'
)
def
test_idna
(
self
):
# Check for internet access before running test (issue #12804).
try
:
socket
.
gethostbyname
(
'python.org'
)
except
socket
.
gaierror
as
e
:
if
e
.
errno
==
socket
.
EAI_NODATA
:
self
.
skipTest
(
'internet access required for this test'
)
# these should all be successful
socket
.
gethostbyname
(
'испытание.python.org'
)
socket
.
gethostbyname_ex
(
'испытание.python.org'
)
...
...
Lib/test/test_urllib2net.py
Dosyayı görüntüle @
61baebd0
...
...
@@ -83,12 +83,13 @@ class CloseSocketTest(unittest.TestCase):
def
test_close
(
self
):
# calling .close() on urllib2's response objects should close the
# underlying socket
response
=
_urlopen_with_retry
(
"http://www.python.org/"
)
sock
=
response
.
fp
self
.
assertTrue
(
not
sock
.
closed
)
response
.
close
()
self
.
assertTrue
(
sock
.
closed
)
url
=
"http://www.python.org/"
with
support
.
transient_internet
(
url
):
response
=
_urlopen_with_retry
(
url
)
sock
=
response
.
fp
self
.
assertTrue
(
not
sock
.
closed
)
response
.
close
()
self
.
assertTrue
(
sock
.
closed
)
class
OtherNetworkTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
61baebd0
...
...
@@ -461,6 +461,9 @@ Core and Builtins
Library
-------
-
Issue
#
12804
:
Fix
test_socket
and
test_urllib2net
failures
when
running
tests
on
a
system
without
internet
access
.
-
Issue
#
13772
:
In
os
.
symlink
()
under
Windows
,
do
not
try
to
guess
the
link
target
's type (file or directory). The detection was buggy and made the
call non-atomic (therefore prone to race conditions).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment