diff options
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | src/lxml/tests/selftest.py (renamed from selftest.py) | 0 | ||||
-rw-r--r-- | src/lxml/tests/selftest2.py (renamed from selftest2.py) | 0 | ||||
-rw-r--r-- | src/lxml/tests/test_etree.py | 21 |
5 files changed, 14 insertions, 13 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index 3be87311..82a16c90 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 @@ -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 \ diff --git a/selftest.py b/src/lxml/tests/selftest.py index a487473b..a487473b 100644 --- a/selftest.py +++ b/src/lxml/tests/selftest.py diff --git a/selftest2.py b/src/lxml/tests/selftest2.py index d1e289ea..d1e289ea 100644 --- a/selftest2.py +++ b/src/lxml/tests/selftest2.py diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py index f93aaa24..9b2f04c3 100644 --- a/src/lxml/tests/test_etree.py +++ b/src/lxml/tests/test_etree.py @@ -7,6 +7,8 @@ Tests that apply to the general ElementTree API should go into test_elementtree """ +from __future__ import absolute_import + import os.path import unittest import copy @@ -19,14 +21,10 @@ import textwrap 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__) @@ -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')]) |