aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-06 10:08:15 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-06 10:08:15 -0500
commit7d4bd8dabb45242671527282474c84179c967ede (patch)
tree4bb6fc419b26ead6ceb8ca600f8d4b53afa664a3
parent9d04e13b60ccd4ec6058c31e219d6e7d124f9574 (diff)
downloadexternal_python_setuptools-7d4bd8dabb45242671527282474c84179c967ede.tar.gz
external_python_setuptools-7d4bd8dabb45242671527282474c84179c967ede.tar.bz2
external_python_setuptools-7d4bd8dabb45242671527282474c84179c967ede.zip
Use pytest.raises for brevity and clarity of purpose.
-rw-r--r--pkg_resources/tests/test_resources.py5
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):
"""