Created
November 22, 2014 21:23
-
-
Save briancurtin/832e59d079c19b978058 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/openstack/tests/test_resource.py b/openstack/tests/test_resource.py | |
index 74d797b..78df0ac 100644 | |
--- a/openstack/tests/test_resource.py | |
+++ b/openstack/tests/test_resource.py | |
@@ -88,12 +88,8 @@ class PropTests(base.TestCase): | |
t = Test() | |
- try: | |
- t.attr = "this is not an int" | |
- except ValueError: | |
- pass | |
- else: | |
- self.fail("Failed to raise ValueErrorwhen given bad value") | |
+ self.assertRaises(ValueError, setattr, t, "attr", | |
+ "this is not an int") | |
def test_set_TypeError(self): | |
class Type(object): | |
@@ -105,12 +101,8 @@ class PropTests(base.TestCase): | |
t = Test() | |
- try: | |
- t.attr = "this type takes no args" | |
- except TypeError: | |
- pass | |
- else: | |
- self.fail("Failed to raise TypeError when given bad type") | |
+ self.assertRaises(TypeError, setattr, t, "attr", | |
+ "this type takes no args") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment