Skip to content

Commit

Permalink
Merge pull request #33 from stackhpc/upstream/2023.1-2024-07-08
Browse files Browse the repository at this point in the history
Synchronise 2023.1 with upstream
  • Loading branch information
markgoddard authored Jul 9, 2024
2 parents 9c18f8c + edfa24b commit a8c31aa
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions openstack_requirements/tests/test_requirement.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

import textwrap

import pkg_resources
import pkg_resources.extern.packaging.requirements as pkg_resources_reqs
import testscenarios
import testtools

Expand Down Expand Up @@ -107,13 +105,7 @@ class TestParseRequirementFailures(testtools.TestCase):
('-f', dict(line='-f http://tarballs.openstack.org/'))]

def test_does_not_parse(self):
try:
requirement.parse_line(self.line)
except (pkg_resources.RequirementParseError,
pkg_resources_reqs.InvalidRequirement):
pass
else:
self.fail('No exception triggered')
self.assertRaises(ValueError, requirement.parse_line, self.line)


class TestToContent(testtools.TestCase):
Expand Down Expand Up @@ -153,13 +145,8 @@ def test_urls(self):
self.assertEqual(reqs, [(req, line)])

def test_not_urls(self):
try:
list(requirement.to_reqs('file:///foo#egg=foo'))
except (pkg_resources.RequirementParseError,
pkg_resources_reqs.InvalidRequirement):
pass
else:
self.fail('No exception triggered')
self.assertRaises(
ValueError, list, requirement.to_reqs('file:///foo#egg=foo'))

def test_multiline(self):
content = textwrap.dedent("""\
Expand Down

0 comments on commit a8c31aa

Please sign in to comment.