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
da57819e
Kaydet (Commit)
da57819e
authored
Şub 16, 2012
tarafından
Eli Bendersky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
in the tests of ElementTree, verify that the C accelerator is imported or not imported as expected
üst
4aec7761
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
test_xml_etree.py
Lib/test/test_xml_etree.py
+10
-0
test_xml_etree_c.py
Lib/test/test_xml_etree_c.py
+11
-1
No files found.
Lib/test/test_xml_etree.py
Dosyayı görüntüle @
da57819e
...
...
@@ -1904,12 +1904,22 @@ class CleanContext(object):
self
.
checkwarnings
.
__exit__
(
*
args
)
class
TestAcceleratorNotImported
(
unittest
.
TestCase
):
# Test that the C accelerator was not imported for pyET
def
test_correct_import_pyET
(
self
):
# In the C accelerator, Element is just a factory function, not an
# actual class. In the Python version it's a class.
self
.
assertIsInstance
(
pyET
.
Element
,
type
)
def
test_main
(
module
=
pyET
):
from
test
import
test_xml_etree
# The same doctests are used for both the Python and the C implementations
test_xml_etree
.
ET
=
module
support
.
run_unittest
(
TestAcceleratorNotImported
)
# XXX the C module should give the same warnings as the Python module
with
CleanContext
(
quiet
=
(
module
is
not
pyET
)):
support
.
run_doctest
(
test_xml_etree
,
verbosity
=
True
)
...
...
Lib/test/test_xml_etree_c.py
Dosyayı görüntüle @
da57819e
...
...
@@ -46,6 +46,16 @@ class MiscTests(unittest.TestCase):
finally
:
data
=
None
class
TestAcceleratorImported
(
unittest
.
TestCase
):
# Test that the C accelerator was imported, as expected
def
test_correct_import_cET
(
self
):
# In the C accelerator, Element is just a factory function, not an
# actual class. In the Python version it's a class.
self
.
assertNotIsInstance
(
cET
.
Element
,
type
)
def
test_correct_import_cET_alias
(
self
):
self
.
assertNotIsInstance
(
cET_alias
.
Element
,
type
)
def
test_main
():
from
test
import
test_xml_etree
,
test_xml_etree_c
...
...
@@ -53,7 +63,7 @@ def test_main():
# Run the tests specific to the C implementation
support
.
run_doctest
(
test_xml_etree_c
,
verbosity
=
True
)
support
.
run_unittest
(
MiscTests
)
support
.
run_unittest
(
MiscTests
,
TestAcceleratorImported
)
# Run the same test suite as the Python module
test_xml_etree
.
test_main
(
module
=
cET
)
...
...
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