Skip to content

Commit

Permalink
Test of 'nul' for Windows checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mknorps committed Oct 26, 2023
1 parent c9276c3 commit b3e174a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.11"]
os: [macos-latest, windows-latest, ubuntu-latest]
# os: [macos-latest, windows-latest, ubuntu-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
os: [macos-latest, windows-latest, ubuntu-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/self_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [macos-latest, windows-latest, ubuntu-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
Expand Down
9 changes: 8 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,16 @@ def unused_factory(*deps: str) -> List[UnusedDependency]:
return [UnusedDependency(dep, [Location(Path("foo"))]) for dep in deps]


def _config_file_name():
if sys.platform.startswith("win"):
return Path("nul")
else:
return Path("/dev/null")


def run_fawltydeps_subprocess(
*args: str,
config_file: Path = Path("/dev/null"),
config_file: Path = _config_file_name(),
to_stdin: Optional[str] = None,
cwd: Optional[Path] = None,
) -> Tuple[str, str, int]:
Expand Down

0 comments on commit b3e174a

Please sign in to comment.