Skip to content

Commit

Permalink
properly integrate original ET selftest modules into test runner
Browse files Browse the repository at this point in the history
--HG--
rename : selftest.py => src/lxml/tests/selftest.py
rename : selftest2.py => src/lxml/tests/selftest2.py
  • Loading branch information
scoder committed Mar 6, 2015
1 parent 5bd6867 commit 1e4c469
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
exclude *.py
include setup.py ez_setup.py setupinfo.py versioninfo.py buildlibxml.py
include test.py selftest.py selftest2.py
include test.py
include update-error-constants.py
include MANIFEST.in Makefile version.txt requirements.txt
include CHANGES.txt CREDITS.txt INSTALL.txt LICENSES.txt README.rst TODO.txt
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,10 @@ test_build: build

test_inplace: inplace
$(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS) $(CYTHON_WITH_COVERAGE)
PYTHONPATH=src:$(PYTHONPATH) $(PYTHON) selftest.py
PYTHONPATH=src:$(PYTHONPATH) $(PYTHON) selftest2.py

test_inplace3: inplace
$(PYTHON3) setup.py $(SETUPFLAGS) build_ext -i $(PY3_WITH_CYTHON)
$(PYTHON3) test.py $(TESTFLAGS) $(TESTOPTS) $(CYTHON3_WITH_COVERAGE)
PYTHONPATH=src:$(PYTHONPATH) $(PYTHON3) selftest.py
PYTHONPATH=src:$(PYTHONPATH) $(PYTHON3) selftest2.py

valgrind_test_inplace: inplace
valgrind --tool=memcheck --leak-check=full --num-callers=30 --suppressions=valgrind-python.supp \
Expand Down
File renamed without changes.
File renamed without changes.
21 changes: 13 additions & 8 deletions src/lxml/tests/test_etree.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
test_elementtree
"""

from __future__ import absolute_import

import os.path
import unittest
import copy
Expand All @@ -19,14 +21,10 @@
import zlib
import gzip

this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.insert(0, this_dir) # needed for Py3

from common_imports import etree, StringIO, BytesIO, HelperTestCase
from common_imports import fileInTestDir, fileUrlInTestDir, read_file, path2url
from common_imports import SillyFileLike, LargeFileLikeUnicode, doctest, make_doctest
from common_imports import canonicalize, sorted, _str, _bytes
from .common_imports import etree, StringIO, BytesIO, HelperTestCase
from .common_imports import fileInTestDir, fileUrlInTestDir, read_file, path2url
from .common_imports import SillyFileLike, LargeFileLikeUnicode, doctest, make_doctest
from .common_imports import canonicalize, sorted, _str, _bytes

print("")
print("TESTED VERSION: %s" % etree.__version__)
Expand Down Expand Up @@ -4468,6 +4466,13 @@ def test_suite():
suite.addTests([unittest.makeSuite(ETreeWriteTestCase)])
suite.addTests([unittest.makeSuite(ETreeErrorLogTest)])
suite.addTests([unittest.makeSuite(XMLPullParserTest)])

# add original doctests from ElementTree selftest modules
from . import selftest, selftest2
suite.addTests(doctest.DocTestSuite(selftest))
suite.addTests(doctest.DocTestSuite(selftest2))

# add doctests
suite.addTests(doctest.DocTestSuite(etree))
suite.addTests(
[make_doctest('../../../doc/tutorial.txt')])
Expand Down

0 comments on commit 1e4c469

Please sign in to comment.