01-fix-tests.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --- contrib/python/pytz/py2/pytz/tests/test_docs.py (index)
  2. +++ contrib/python/pytz/py2/pytz/tests/test_docs.py (working tree)
  3. @@ -1,34 +1,15 @@
  4. # -*- coding: ascii -*-
  5. -from doctest import DocFileSuite
  6. -import unittest
  7. -import os.path
  8. -import sys
  9. +import doctest
  10. -THIS_DIR = os.path.dirname(__file__)
  11. +import pytz
  12. +import pytz.tzinfo
  13. -README = os.path.join(THIS_DIR, os.pardir, os.pardir, 'README.rst')
  14. +def test_doctest_pytz():
  15. + nfailures, ntests = doctest.testmod(pytz)
  16. + assert not nfailures
  17. -class DocumentationTestCase(unittest.TestCase):
  18. - def test_readme_encoding(self):
  19. - '''Confirm the README.rst is ASCII.'''
  20. - f = open(README, 'rb')
  21. - try:
  22. - f.read().decode('ASCII')
  23. - finally:
  24. - f.close()
  25. -
  26. -
  27. -def test_suite():
  28. - "For the Z3 test runner"
  29. - return unittest.TestSuite((
  30. - DocumentationTestCase('test_readme_encoding'),
  31. - DocFileSuite(os.path.join(os.pardir, os.pardir, 'README.rst'))))
  32. -
  33. -
  34. -if __name__ == '__main__':
  35. - sys.path.insert(
  36. - 0, os.path.abspath(os.path.join(THIS_DIR, os.pardir, os.pardir))
  37. - )
  38. - unittest.main(defaultTest='test_suite')
  39. +def test_doctest_pytz_tzinfo():
  40. + nfailures, ntests = doctest.testmod(pytz.tzinfo)
  41. + assert not nfailures
  42. --- contrib/python/pytz/py2/pytz/tests/test_tzinfo.py (index)
  43. +++ contrib/python/pytz/py2/pytz/tests/test_tzinfo.py (working tree)
  44. @@ -857,1 +857,1 @@ class DstTzInfoTestCase(unittest.TestCase, BaseTzInfoTestCase):
  45. -def test_suite():
  46. +def _test_suite():