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
6319e0fa
Kaydet (Commit)
6319e0fa
authored
Haz 16, 2012
tarafından
Eli Bendersky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make the test more resilient to test-run order (closes #15075)
üst
07621338
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
test_xml_etree.py
Lib/test/test_xml_etree.py
+20
-8
No files found.
Lib/test/test_xml_etree.py
Dosyayı görüntüle @
6319e0fa
...
@@ -1279,8 +1279,7 @@ def xinclude_loader(href, parse="xml", encoding=None):
...
@@ -1279,8 +1279,7 @@ def xinclude_loader(href, parse="xml", encoding=None):
except
KeyError
:
except
KeyError
:
raise
OSError
(
"resource not found"
)
raise
OSError
(
"resource not found"
)
if
parse
==
"xml"
:
if
parse
==
"xml"
:
from
xml.etree.ElementTree
import
XML
data
=
ET
.
XML
(
data
)
return
XML
(
data
)
return
data
return
data
def
xinclude
():
def
xinclude
():
...
@@ -2011,12 +2010,20 @@ class TreeBuilderTest(unittest.TestCase):
...
@@ -2011,12 +2010,20 @@ class TreeBuilderTest(unittest.TestCase):
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'
))
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'
))
@unittest.skip
(
'Unstable due to module monkeypatching'
)
class
XincludeTest
(
unittest
.
TestCase
):
class
XincludeTest
(
unittest
.
TestCase
):
def
_my_loader
(
self
,
href
,
parse
):
# Used to avoid a test-dependency problem where the default loader
# of ElementInclude uses the pyET parser for cET tests.
if
parse
==
'xml'
:
with
open
(
href
,
'rb'
)
as
f
:
return
ET
.
parse
(
f
)
.
getroot
()
else
:
return
None
def
test_xinclude_default
(
self
):
def
test_xinclude_default
(
self
):
from
xml.etree
import
ElementInclude
from
xml.etree
import
ElementInclude
doc
=
xinclude_loader
(
'default.xml'
)
doc
=
xinclude_loader
(
'default.xml'
)
ElementInclude
.
include
(
doc
)
ElementInclude
.
include
(
doc
,
self
.
_my_loader
)
s
=
serialize
(
doc
)
s
=
serialize
(
doc
)
self
.
assertEqual
(
s
.
strip
(),
'''<document>
self
.
assertEqual
(
s
.
strip
(),
'''<document>
<p>Example.</p>
<p>Example.</p>
...
@@ -2308,11 +2315,16 @@ def test_main(module=None):
...
@@ -2308,11 +2315,16 @@ def test_main(module=None):
NoAcceleratorTest
,
NoAcceleratorTest
,
])
])
support
.
run_unittest
(
*
test_classes
)
try
:
support
.
run_unittest
(
*
test_classes
)
# XXX the C module should give the same warnings as the Python module
with
CleanContext
(
quiet
=
(
module
is
not
pyET
)):
support
.
run_doctest
(
sys
.
modules
[
__name__
],
verbosity
=
True
)
finally
:
# don't interfere with subsequent tests
ET
=
pyET
=
None
# XXX the C module should give the same warnings as the Python module
with
CleanContext
(
quiet
=
(
module
is
not
pyET
)):
support
.
run_doctest
(
sys
.
modules
[
__name__
],
verbosity
=
True
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_main
()
test_main
()
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