-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test_console failure finding pipdeptree in other environments (#351)
When we are using pytest in packaging process, we may not get the `/usr/bin/pipdeptree` as we need. So, let's use the `PATH` env to get the binary instead. fix: #348 Signed-off-by: cunshunxia <[email protected]>
- Loading branch information
1 parent
bf5a865
commit 6d4d4a7
Showing
2 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
from pathlib import Path | ||
from subprocess import check_call # noqa: S404 | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from pytest_console_scripts import ScriptRunner | ||
|
||
|
||
def test_main() -> None: | ||
check_call([sys.executable, "-m", "pipdeptree", "--help"]) | ||
|
||
|
||
def test_console() -> None: | ||
check_call([Path(sys.executable).parent / "pipdeptree", "--help"]) | ||
def test_console(script_runner: ScriptRunner) -> None: | ||
result = script_runner.run("pipdeptree", "--help") | ||
assert result.success |