Skip to content

Commit c6036b7

Browse files
rouge8cjerdonek
authored andcommitted
PR feedback
1 parent 3a40284 commit c6036b7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

news/6419.bugfix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fix NameError when handling InvalidRequirement in install_req_from_req_string.
1+
Fix ``NameError`` when handling an invalid requirement.

tests/unit/test_req_install.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ def test_install_req_from_string_invalid_requirement(self):
5555
Requirement strings that cannot be parsed by
5656
packaging.requirements.Requirement raise an InstallationError.
5757
"""
58-
with pytest.raises(InstallationError):
58+
with pytest.raises(InstallationError) as excinfo:
5959
install_req_from_req_string("http:/this/is/invalid")
6060

61+
assert str(excinfo.value) == (
62+
"Invalid requirement: 'http:/this/is/invalid'"
63+
)
64+
6165
def test_install_req_from_string_without_comes_from(self):
6266
"""
6367
Test to make sure that install_req_from_string succeeds

0 commit comments

Comments
 (0)