Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
292f9a89
Commit
292f9a89
authored
Feb 16, 2012
by
Eli Bendersky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make TestAccelerator[Not]Imported for ElementTree more robust
parent
66e6f8e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
+3
-9
Lib/test/test_xml_etree.py
Lib/test/test_xml_etree.py
+1
-3
Lib/test/test_xml_etree_c.py
Lib/test/test_xml_etree_c.py
+2
-6
No files found.
Lib/test/test_xml_etree.py
View file @
292f9a89
...
...
@@ -1907,9 +1907,7 @@ class CleanContext(object):
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
)
self
.
assertEqual
(
pyET
.
Element
.
__module__
,
'xml.etree.ElementTree'
)
def
test_main
(
module
=
pyET
):
...
...
Lib/test/test_xml_etree_c.py
View file @
292f9a89
...
...
@@ -46,15 +46,11 @@ class MiscTests(unittest.TestCase):
finally
:
data
=
None
@
unittest
.
skipUnless
(
cET
,
'requires _elementtree'
)
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)
self
.
assertEqual
(
cET
.
Element
.
__module__
,
'_elementtree'
)
def
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