Skip to content

Commit

Permalink
Fix ci for win
Browse files Browse the repository at this point in the history
  • Loading branch information
eggplants committed Dec 2, 2024
1 parent c4b187f commit 0b778dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,22 @@ jobs:
- '3.13'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Setup
shell: bash
run: |
poetry install --no-interaction
poetry run task download-latest-jar
export DOWNLOAD_LATEST_ONLY=1
poetry run task publish
- name: Test
run: |
poetry run task test
7 changes: 4 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import os
import re
from typing import TYPE_CHECKING

Expand All @@ -14,7 +15,7 @@ def test_cli_version(capfd: pytest.CaptureFixture[str]) -> None:
assert result.returncode == 0

captured = capfd.readouterr()
assert re.match(r"^\d+\.\d+\.\d+(?:-beta\d*)?$", captured.out.split("\n")[0])
assert re.match(r"^\d+\.\d+\.\d+(?:-beta\d*)?$", captured.out.split(os.linesep)[0])
assert not captured.err


Expand All @@ -23,7 +24,7 @@ def test_no_args(capfd: pytest.CaptureFixture[str]) -> None:
assert result.returncode == 1

captured = capfd.readouterr()
assert captured.out.split("\n")[0] in (
assert captured.out.split(os.linesep)[0] in (
# >=5.0.0
"usage: openapi-generator-cli <command> [<args>]",
# >=3.0.1,<5.0.0
Expand All @@ -40,4 +41,4 @@ def test_invalid_arg(capfd: pytest.CaptureFixture[str]) -> None:

captured = capfd.readouterr()
assert not captured.out
assert "Found unexpected parameters: [--invalid-arg-404]" in captured.err.split("\n")[0]
assert "Found unexpected parameters: [--invalid-arg-404]" in captured.err.split(os.linesep)[0]

0 comments on commit 0b778dd

Please sign in to comment.