summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-01-08 01:23:02 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-01-08 01:23:02 (GMT)
commit0dd06f4082355451847e686d6adb2f1a9f749adb (patch)
tree87646fee0523846b1e11bf1aab34ecffcaffb883 /Lib/test
parentb8bb4664fc8cb833f0fd50c9dac4f6c3be032784 (diff)
downloadcpython-0dd06f4082355451847e686d6adb2f1a9f749adb.zip
cpython-0dd06f4082355451847e686d6adb2f1a9f749adb.tar.gz
cpython-0dd06f4082355451847e686d6adb2f1a9f749adb.tar.bz2
Fixed error handling branches. Thanks
Victor Stinner for pointing this out.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_time.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index e4b6a0f..d3de933 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -308,13 +308,24 @@ class TestDontAccept2Year(TestAccept2Year):
def test_invalid(self):
pass
+class TestAccept2YearBad(TestAccept2Year):
+ class X:
+ def __bool__(self):
+ raise RuntimeError('boo')
+ accept2dyear = X()
+ def test_2dyear(self):
+ pass
+ def test_invalid(self):
+ self.assertRaises(RuntimeError, self.yearstr, 200)
+
+
class TestDontAccept2YearBool(TestDontAccept2Year):
accept2dyear = False
def test_main():
support.run_unittest(TimeTestCase, TestLocale,
- TestAccept2Year, TestAccept2YearBool,
+ TestAccept2Year, TestAccept2YearBool, TestAccept2YearBad,
TestDontAccept2Year, TestDontAccept2YearBool)
if __name__ == "__main__":