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
28b0d9d1
Kaydet (Commit)
28b0d9d1
authored
Haz 08, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#17691: test_univnewlines now works with unittest test discovery. Patch by Zachary Ware.
üst
ba6c0d3b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
21 deletions
+19
-21
test_univnewlines.py
Lib/test/test_univnewlines.py
+16
-21
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_univnewlines.py
Dosyayı görüntüle @
28b0d9d1
...
@@ -30,7 +30,13 @@ DATA_CRLF = "\r\n".join(DATA_TEMPLATE) + "\r\n"
...
@@ -30,7 +30,13 @@ DATA_CRLF = "\r\n".join(DATA_TEMPLATE) + "\r\n"
DATA_MIXED
=
"
\n
"
.
join
(
DATA_TEMPLATE
)
+
"
\r
"
DATA_MIXED
=
"
\n
"
.
join
(
DATA_TEMPLATE
)
+
"
\r
"
DATA_SPLIT
=
[
x
+
"
\n
"
for
x
in
DATA_TEMPLATE
]
DATA_SPLIT
=
[
x
+
"
\n
"
for
x
in
DATA_TEMPLATE
]
class
TestGenericUnivNewlines
(
unittest
.
TestCase
):
class
CTest
:
open
=
io
.
open
class
PyTest
:
open
=
staticmethod
(
pyio
.
open
)
class
TestGenericUnivNewlines
:
# use a class variable DATA to define the data to write to the file
# use a class variable DATA to define the data to write to the file
# and a class variable NEWLINE to set the expected newlines value
# and a class variable NEWLINE to set the expected newlines value
READMODE
=
'r'
READMODE
=
'r'
...
@@ -85,10 +91,14 @@ class TestGenericUnivNewlines(unittest.TestCase):
...
@@ -85,10 +91,14 @@ class TestGenericUnivNewlines(unittest.TestCase):
class
TestCRNewlines
(
TestGenericUnivNewlines
):
class
TestCRNewlines
(
TestGenericUnivNewlines
):
NEWLINE
=
'
\r
'
NEWLINE
=
'
\r
'
DATA
=
DATA_CR
DATA
=
DATA_CR
class
CTestCRNewlines
(
CTest
,
TestCRNewlines
,
unittest
.
TestCase
):
pass
class
PyTestCRNewlines
(
PyTest
,
TestCRNewlines
,
unittest
.
TestCase
):
pass
class
TestLFNewlines
(
TestGenericUnivNewlines
):
class
TestLFNewlines
(
TestGenericUnivNewlines
):
NEWLINE
=
'
\n
'
NEWLINE
=
'
\n
'
DATA
=
DATA_LF
DATA
=
DATA_LF
class
CTestLFNewlines
(
CTest
,
TestLFNewlines
,
unittest
.
TestCase
):
pass
class
PyTestLFNewlines
(
PyTest
,
TestLFNewlines
,
unittest
.
TestCase
):
pass
class
TestCRLFNewlines
(
TestGenericUnivNewlines
):
class
TestCRLFNewlines
(
TestGenericUnivNewlines
):
NEWLINE
=
'
\r\n
'
NEWLINE
=
'
\r\n
'
...
@@ -100,29 +110,14 @@ class TestCRLFNewlines(TestGenericUnivNewlines):
...
@@ -100,29 +110,14 @@ class TestCRLFNewlines(TestGenericUnivNewlines):
data
=
fp
.
readline
()
data
=
fp
.
readline
()
pos
=
fp
.
tell
()
pos
=
fp
.
tell
()
self
.
assertEqual
(
repr
(
fp
.
newlines
),
repr
(
self
.
NEWLINE
))
self
.
assertEqual
(
repr
(
fp
.
newlines
),
repr
(
self
.
NEWLINE
))
class
CTestCRLFNewlines
(
CTest
,
TestCRLFNewlines
,
unittest
.
TestCase
):
pass
class
PyTestCRLFNewlines
(
PyTest
,
TestCRLFNewlines
,
unittest
.
TestCase
):
pass
class
TestMixedNewlines
(
TestGenericUnivNewlines
):
class
TestMixedNewlines
(
TestGenericUnivNewlines
):
NEWLINE
=
(
'
\r
'
,
'
\n
'
)
NEWLINE
=
(
'
\r
'
,
'
\n
'
)
DATA
=
DATA_MIXED
DATA
=
DATA_MIXED
class
CTestMixedNewlines
(
CTest
,
TestMixedNewlines
,
unittest
.
TestCase
):
pass
class
PyTestMixedNewlines
(
PyTest
,
TestMixedNewlines
,
unittest
.
TestCase
):
pass
def
test_main
():
base_tests
=
(
TestCRNewlines
,
TestLFNewlines
,
TestCRLFNewlines
,
TestMixedNewlines
)
tests
=
[]
# Test the C and Python implementations.
for
test
in
base_tests
:
class
CTest
(
test
):
open
=
io
.
open
CTest
.
__name__
=
"C"
+
test
.
__name__
class
PyTest
(
test
):
open
=
staticmethod
(
pyio
.
open
)
PyTest
.
__name__
=
"Py"
+
test
.
__name__
tests
.
append
(
CTest
)
tests
.
append
(
PyTest
)
support
.
run_unittest
(
*
tests
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_
main
()
unittest
.
main
()
Misc/NEWS
Dosyayı görüntüle @
28b0d9d1
...
@@ -84,6 +84,9 @@ IDLE
...
@@ -84,6 +84,9 @@ IDLE
Tests
Tests
-----
-----
-
Issue
#
17691
:
test_univnewlines
now
works
with
unittest
test
discovery
.
Patch
by
Zachary
Ware
.
-
Issue
#
18094
:
test_uuid
no
more
reports
skipped
tests
as
passed
.
-
Issue
#
18094
:
test_uuid
no
more
reports
skipped
tests
as
passed
.
-
Issue
#
11995
:
test_pydoc
doesn
't import all sys.path modules anymore.
-
Issue
#
11995
:
test_pydoc
doesn
't import all sys.path modules anymore.
...
...
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