aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pytz/py2/patches/01-fix-tests.patch
blob: 54a7a5e70cc6cdc048f7ffcab1295c7e0be46509 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--- 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():