diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-06 10:08:15 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-06 10:08:15 -0500 |
commit | 8646df249643fa93a562c09e49586a50f84a09c5 (patch) | |
tree | 992d861fc4776f21daada760f30343f3b835042e /pkg_resources | |
parent | 967b8ddeaee600af04bd77d8a4f969043f3f071a (diff) | |
download | python-setuptools-bitbucket-8646df249643fa93a562c09e49586a50f84a09c5.tar.gz |
Use pytest.raises for brevity and clarity of purpose.
Diffstat (limited to 'pkg_resources')
-rw-r--r-- | pkg_resources/tests/test_resources.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py index 9c1eaeec..a55478a2 100644 --- a/pkg_resources/tests/test_resources.py +++ b/pkg_resources/tests/test_resources.py @@ -298,9 +298,8 @@ class TestEntryPoints: reject_specs = "foo", "x=a:b:c", "q=x/na", "fez=pish:tush-z", "x=f[a]>2" @pytest.mark.parametrize("reject_spec", reject_specs) def test_reject_spec(self, reject_spec): - try: EntryPoint.parse(reject_spec) - except ValueError: pass - else: raise AssertionError("Should've been bad", reject_spec) + with pytest.raises(ValueError): + EntryPoint.parse(reject_spec) def test_printable_name(self): """ |