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
2dfa6cb9
Kaydet (Commit)
2dfa6cb9
authored
Şub 06, 2017
tarafından
Steve Dower
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #28164: Improves test on Windows 7
üst
f007b49e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
16 deletions
+22
-16
test_winconsoleio.py
Lib/test/test_winconsoleio.py
+22
-16
No files found.
Lib/test/test_winconsoleio.py
Dosyayı görüntüle @
2dfa6cb9
...
...
@@ -6,6 +6,7 @@ import os
import
sys
import
tempfile
import
unittest
from
test
import
support
if
sys
.
platform
!=
'win32'
:
raise
unittest
.
SkipTest
(
"test only relevant on win32"
)
...
...
@@ -97,23 +98,28 @@ class WindowsConsoleIOTests(unittest.TestCase):
self
.
assertIsInstance
(
f
,
ConIO
)
f
.
close
()
try
:
f
=
open
(
r'\\.\conin$'
,
'rb'
,
buffering
=
0
)
except
FileNotFoundError
:
# If we cannot find the file, this part should be skipped
print
(
'
\\\\
.
\\
conin$ was not found on this OS'
)
else
:
self
.
assertIsInstance
(
f
,
ConIO
)
f
.
close
()
@unittest.skipIf
(
sys
.
getwindowsversion
()[:
2
]
<=
(
6
,
1
),
"test does not work on Windows 7 and earlier"
)
def
test_conin_conout_names
(
self
):
f
=
open
(
r'\\.\conin$'
,
'rb'
,
buffering
=
0
)
self
.
assertIsInstance
(
f
,
ConIO
)
f
.
close
()
try
:
f
=
open
(
'//?/conout$'
,
'wb'
,
buffering
=
0
)
except
FileNotFoundError
:
# If we cannot find the file, this part should be skipped
print
(
'//?/conout$ was not found on this OS'
)
else
:
self
.
assertIsInstance
(
f
,
ConIO
)
f
.
close
()
f
=
open
(
'//?/conout$'
,
'wb'
,
buffering
=
0
)
self
.
assertIsInstance
(
f
,
ConIO
)
f
.
close
()
def
test_conout_path
(
self
):
temp_path
=
tempfile
.
mkdtemp
()
self
.
addCleanup
(
support
.
rmtree
,
temp_path
)
conout_path
=
os
.
path
.
join
(
temp_path
,
'CONOUT$'
)
with
open
(
conout_path
,
'wb'
,
buffering
=
0
)
as
f
:
if
sys
.
getwindowsversion
()[:
2
]
>
(
6
,
1
):
self
.
assertIsInstance
(
f
,
ConIO
)
else
:
self
.
assertNotIsInstance
(
f
,
ConIO
)
def
assertStdinRoundTrip
(
self
,
text
):
stdin
=
open
(
'CONIN$'
,
'r'
)
...
...
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