diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-06 10:07:03 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-06 10:07:03 -0500 |
| commit | 9d04e13b60ccd4ec6058c31e219d6e7d124f9574 (patch) | |
| tree | c840826987a0abd59836ee0b6b56ff7bc040765f /pkg_resources/tests | |
| parent | de11e9e9b57db01e029657acb1148a9fd70581b5 (diff) | |
| download | python-setuptools-git-9d04e13b60ccd4ec6058c31e219d6e7d124f9574.tar.gz | |
Use pytests parametrize to create separate tests for each spec
Diffstat (limited to 'pkg_resources/tests')
| -rw-r--r-- | pkg_resources/tests/test_resources.py | 12 |
1 files changed, 6 insertions, 6 deletions
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): """ |
