Skip to content

Commit

Permalink
Add test: invalid setup.py parse failure handling
Browse files Browse the repository at this point in the history
  • Loading branch information
AndydeCleyre committed May 31, 2022
1 parent bbf5121 commit e3b29a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_cli_compile.py
Expand Up @@ -1011,6 +1011,16 @@ def test_filter_pip_markers(pip_conf, runner):
assert "unknown_package" not in out.stderr


def test_bad_setup_file(runner):
with open("setup.py", "w") as package:
package.write("BAD SYNTAX")

out = runner.invoke(cli, [])

assert out.exit_code == 2
assert f"Failed to parse {os.path.abspath('setup.py')}" in out.stderr


def test_no_candidates(pip_conf, runner):
with open("requirements", "w") as req_in:
req_in.write("small-fake-a>0.3b1,<0.3b2")
Expand Down

0 comments on commit e3b29a8

Please sign in to comment.