--- contrib/python/pytz/py2/pytz/tests/test_docs.py (index) +++ contrib/python/pytz/py2/pytz/tests/test_docs.py (working tree) @@ -1,34 +1,15 @@ # -*- coding: ascii -*- -from doctest import DocFileSuite -import unittest -import os.path -import sys +import doctest -THIS_DIR = os.path.dirname(__file__) +import pytz +import pytz.tzinfo -README = os.path.join(THIS_DIR, os.pardir, os.pardir, 'README.rst') +def test_doctest_pytz(): + nfailures, ntests = doctest.testmod(pytz) + assert not nfailures -class DocumentationTestCase(unittest.TestCase): - def test_readme_encoding(self): - '''Confirm the README.rst is ASCII.''' - f = open(README, 'rb') - try: - f.read().decode('ASCII') - finally: - f.close() - - -def test_suite(): - "For the Z3 test runner" - return unittest.TestSuite(( - DocumentationTestCase('test_readme_encoding'), - DocFileSuite(os.path.join(os.pardir, os.pardir, 'README.rst')))) - - -if __name__ == '__main__': - sys.path.insert( - 0, os.path.abspath(os.path.join(THIS_DIR, os.pardir, os.pardir)) - ) - unittest.main(defaultTest='test_suite') +def test_doctest_pytz_tzinfo(): + nfailures, ntests = doctest.testmod(pytz.tzinfo) + assert not nfailures --- contrib/python/pytz/py2/pytz/tests/test_tzinfo.py (index) +++ contrib/python/pytz/py2/pytz/tests/test_tzinfo.py (working tree) @@ -857,1 +857,1 @@ class DstTzInfoTestCase(unittest.TestCase, BaseTzInfoTestCase): -def test_suite(): +def _test_suite():