From 9d04e13b60ccd4ec6058c31e219d6e7d124f9574 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 6 Jan 2015 10:07:03 -0500 Subject: Use pytests parametrize to create separate tests for each spec --- pkg_resources/tests/test_resources.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pkg_resources/tests') diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py index 36cb6482..9c1eaeec 100644 --- a/pkg_resources/tests/test_resources.py +++ b/pkg_resources/tests/test_resources.py @@ -295,12 +295,12 @@ class TestEntryPoints: ep = EntryPoint.parse(spec) assert ep.name == 'html+mako' - def testRejects(self): - specs = "foo", "x=a:b:c", "q=x/na", "fez=pish:tush-z", "x=f[a]>2" - for ep in specs: - try: EntryPoint.parse(ep) - except ValueError: pass - else: raise AssertionError("Should've been bad", ep) + 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) def test_printable_name(self): """ -- cgit v1.2.3