summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_structseq.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-01-15 03:02:37 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-01-15 03:02:37 (GMT)
commitc216df9288d03d43462c87dd9ee2ae3c340376a5 (patch)
tree5ab5cd43a8f75d4dac2f6777e09315b5e78eb453 /Lib/test/test_structseq.py
parenta01ed0305885d57731c0be69c7c0b10200e48535 (diff)
downloadcpython-c216df9288d03d43462c87dd9ee2ae3c340376a5.zip
cpython-c216df9288d03d43462c87dd9ee2ae3c340376a5.tar.gz
cpython-c216df9288d03d43462c87dd9ee2ae3c340376a5.tar.bz2
Issue 1820: structseq objects did not work with the % formatting operator or isinstance(t, tuple).
Orignal patch (without tests) by Leif Walsh.
Diffstat (limited to 'Lib/test/test_structseq.py')
-rw-r--r--Lib/test/test_structseq.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_structseq.py b/Lib/test/test_structseq.py
index 83c7ccf..02c2f72 100644
--- a/Lib/test/test_structseq.py
+++ b/Lib/test/test_structseq.py
@@ -26,6 +26,12 @@ class StructSeqTest(unittest.TestCase):
for i in xrange(-len(t), len(t)-1):
self.assertEqual(t[i], astuple[i])
+ def test_tuple_subclass(self):
+ # Issue 1820
+ t = time.localtime()
+ s = ('%s ' * len(t)) % t # This used to fail because t was not a tuple subclass
+ self.assert_(isinstance(t, tuple))
+
def test_repr(self):
t = time.gmtime()
self.assert_(repr(t))