summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial/stdlib.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2013-03-22 14:26:57 (GMT)
committerRaymond Hettinger <python@rcn.com>2013-03-22 14:26:57 (GMT)
commit671ddbe5a0afcd32203a334372f9db5f0ac076ba (patch)
tree2517d5382999f2871e025b835be285063da57057 /Doc/tutorial/stdlib.rst
parent440282ba8a32271b9c727ed78f85afab3015fec0 (diff)
parent8f35c891e78c6deafcdc77650bce7e8480e83195 (diff)
downloadcpython-671ddbe5a0afcd32203a334372f9db5f0ac076ba.zip
cpython-671ddbe5a0afcd32203a334372f9db5f0ac076ba.tar.gz
cpython-671ddbe5a0afcd32203a334372f9db5f0ac076ba.tar.bz2
merge
Diffstat (limited to 'Doc/tutorial/stdlib.rst')
-rw-r--r--Doc/tutorial/stdlib.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/tutorial/stdlib.rst b/Doc/tutorial/stdlib.rst
index cb892fd..2e3ed18 100644
--- a/Doc/tutorial/stdlib.rst
+++ b/Doc/tutorial/stdlib.rst
@@ -281,8 +281,10 @@ file::
def test_average(self):
self.assertEqual(average([20, 30, 70]), 40.0)
self.assertEqual(round(average([1, 5, 7]), 1), 4.3)
- self.assertRaises(ZeroDivisionError, average, [])
- self.assertRaises(TypeError, average, 20, 30, 70)
+ with self.assertRaises(ZeroDivisionError):
+ average([])
+ with self.assertRaises(TypeError):
+ average(20, 30, 70)
unittest.main() # Calling from the command line invokes all tests