Permalink
Browse files

Use with statement for assert_raises

  • Loading branch information...
mdboom committed May 15, 2013
1 parent 4c9a407 commit 3f032d9b7d82f7c61b533889a2277edac14269d7
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/matplotlib/tests/test_path.py
@@ -2,8 +2,7 @@
from nose.tools import assert_raises
def test_readonly_path():
- def readonly():
- path = Path.unit_circle()
- path.vertices = path.vertices * 2.0
+ path = Path.unit_circle()
- assert_raises(AttributeError, readonly)
+ with assert_raises(AttributeError):
+ path.vertices = path.vertices * 2.0

0 comments on commit 3f032d9

Please sign in to comment.