Skip to content

Commit

Permalink
Always skip integration tests on Windows (#963)
Browse files Browse the repository at this point in the history
* Try running integration tests on macOS and Windows

* Allow WindowsPath in run

* Skip erroring tests on Windows

* Revert test matrix
  • Loading branch information
bhrutledge committed Dec 18, 2022
1 parent 93960db commit ef4d139
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
# it's still helpful to run them on PRs. See:
# https://github.com/pypa/twine/issues/684#issuecomment-703150619
integration:
# Only run on Ubuntu because most of the tests are skipped on Windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
16 changes: 8 additions & 8 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@

pytestmark = [pytest.mark.enable_socket]

run = functools.partial(subprocess.run, check=True)

xfail_win32 = pytest.mark.xfail(
sys.platform == "win32",
reason="pytest-services watcher_getter fixture does not support Windows",
skip_if_windows = pytest.mark.skipif(
platform.system() == "Windows",
reason="pytest-services fixtures don't support Windows",
)

run = functools.partial(subprocess.run, check=True)


@pytest.fixture(scope="session")
def sampleproject_dist(tmp_path_factory: pytest.TempPathFactory):
checkout = tmp_path_factory.mktemp("sampleproject", numbered=False)
tag = datetime.datetime.now().strftime("%Y%m%d%H%M%S%f")

run(["git", "clone", "https://github.com/pypa/sampleproject", checkout])
run(["git", "clone", "https://github.com/pypa/sampleproject", str(checkout)])

pyproject = checkout / "pyproject.toml"
pyproject.write_text(
Expand Down Expand Up @@ -174,7 +174,7 @@ def devpi_run(cmd):
return SimpleNamespace(url=repo, username=username, password=password)


@xfail_win32
@skip_if_windows
def test_devpi_upload(devpi_server, uploadable_dist):
command = [
"upload",
Expand Down Expand Up @@ -222,7 +222,7 @@ def ready():
return SimpleNamespace(url=url)


@xfail_win32
@skip_if_windows
def test_pypiserver_upload(pypiserver_instance, uploadable_dist):
command = [
"upload",
Expand Down

0 comments on commit ef4d139

Please sign in to comment.