Skip to content

Commit 82dd69c

Browse files
committed
python-stdlib: Enable more tests.
Signed-off-by: Damien George <[email protected]>
1 parent fc992b1 commit 82dd69c

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

python-stdlib/contextlib/contextlib.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ class ExitStack(object):
8585
"""
8686

8787
def __init__(self):
88-
self._exit_callbacks = deque()
88+
self._exit_callbacks = []
8989

9090
def pop_all(self):
9191
"""Preserve the context stack by transferring it to a new instance"""
9292
new_stack = type(self)()
9393
new_stack._exit_callbacks = self._exit_callbacks
94-
self._exit_callbacks = deque()
94+
self._exit_callbacks = []
9595
return new_stack
9696

9797
def _push_cm_exit(self, cm, cm_exit):

python-stdlib/contextlib/tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def test_exit_exception_chaining_suppress(self):
399399
def test_excessive_nesting(self):
400400
# The original implementation would die with RecursionError here
401401
with ExitStack() as stack:
402-
for i in range(10000):
402+
for i in range(5000):
403403
stack.callback(int)
404404

405405
def test_instance_bypass(self):

python-stdlib/datetime/test_datetime.py

+2
Original file line numberDiff line numberDiff line change
@@ -2082,9 +2082,11 @@ def test_timetuple00(self):
20822082
with LocalTz("Europe/Rome"):
20832083
self.assertEqual(dt1.timetuple()[:8], (2002, 1, 31, 0, 0, 0, 3, 31))
20842084

2085+
@unittest.skip("broken when running with non-UTC timezone")
20852086
def test_timetuple01(self):
20862087
self.assertEqual(dt27tz2.timetuple()[:8], (2010, 3, 27, 12, 0, 0, 5, 86))
20872088

2089+
@unittest.skip("broken when running with non-UTC timezone")
20882090
def test_timetuple02(self):
20892091
self.assertEqual(dt28tz2.timetuple()[:8], (2010, 3, 28, 12, 0, 0, 6, 87))
20902092

python-stdlib/fnmatch/test_fnmatch.py

-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Test cases for the fnmatch module."""
22

3-
from test import support
43
import unittest
54

65
from fnmatch import fnmatch, fnmatchcase, translate, filter
@@ -79,11 +78,3 @@ def test_translate(self):
7978
class FilterTestCase(unittest.TestCase):
8079
def test_filter(self):
8180
self.assertEqual(filter(["a", "b"], "a"), ["a"])
82-
83-
84-
def main():
85-
support.run_unittest(FnmatchTestCase, TranslateTestCase, FilterTestCase)
86-
87-
88-
if __name__ == "__main__":
89-
main()

0 commit comments

Comments
 (0)