Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rouge8 authored and cjerdonek committed Apr 19, 2019
1 parent 3a40284 commit c6036b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion news/6419.bugfix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fix NameError when handling InvalidRequirement in install_req_from_req_string.
Fix ``NameError`` when handling an invalid requirement.
6 changes: 5 additions & 1 deletion tests/unit/test_req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ def test_install_req_from_string_invalid_requirement(self):
Requirement strings that cannot be parsed by
packaging.requirements.Requirement raise an InstallationError.
"""
with pytest.raises(InstallationError):
with pytest.raises(InstallationError) as excinfo:
install_req_from_req_string("http:/this/is/invalid")

assert str(excinfo.value) == (
"Invalid requirement: 'http:/this/is/invalid'"
)

def test_install_req_from_string_without_comes_from(self):
"""
Test to make sure that install_req_from_string succeeds
Expand Down

0 comments on commit c6036b7

Please sign in to comment.