Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reformatted unit tests
  • Loading branch information
fpgmaas committed Oct 3, 2022
commit 3f386dfe36d9ae57ae76accb3c7390e830b77363
2 changes: 2 additions & 0 deletions tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def dir_with_venv_installed(tmp_path_factory):
assert subprocess.check_call(shlex.split("poetry install --no-interaction --no-root")) == 0
return tmp_path_proj


def test_cli_returns_error(dir_with_venv_installed):
with run_within_dir(dir_with_venv_installed):
result = subprocess.run(shlex.split("poetry run deptry ."), capture_output=True, text=True)
Expand Down Expand Up @@ -71,6 +72,7 @@ def test_cli_extend_exclude(dir_with_venv_installed):
assert result.returncode == 1
assert "The project contains obsolete dependencies:\n\n\tisort\n\trequests\n\ttoml\n\n" in result.stderr


def test_cli_verbose(dir_with_venv_installed):
with run_within_dir(dir_with_venv_installed):
result = subprocess.run(shlex.split("poetry run deptry . "), capture_output=True, text=True)
Expand Down
7 changes: 1 addition & 6 deletions tests/cli/test_cli_pdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ def pdm_dir_with_venv_installed(tmp_path_factory):
tmp_path_proj = tmp_path_factory.getbasetemp() / "project_with_pdm"
shutil.copytree("tests/data/project_with_pdm", str(tmp_path_proj))
with run_within_dir(tmp_path_proj):
assert (
subprocess.check_call(
shlex.split("pip install pdm; pdm install")
)
== 0
)
assert subprocess.check_call(shlex.split("pip install pdm; pdm install")) == 0
return tmp_path_proj


Expand Down
2 changes: 2 additions & 0 deletions tests/cli/test_cli_requirements_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from deptry.utils import run_within_dir


@pytest.fixture(scope="session")
def requirements_txt_dir_with_venv_installed(tmp_path_factory):
tmp_path_proj = tmp_path_factory.getbasetemp() / "project_with_requirements_txt"
Expand All @@ -22,6 +23,7 @@ def requirements_txt_dir_with_venv_installed(tmp_path_factory):
)
return tmp_path_proj


def test_cli_single_requirements_txt(requirements_txt_dir_with_venv_installed):
with run_within_dir(requirements_txt_dir_with_venv_installed):
result = subprocess.run(
Expand Down