Skip to content

Commit

Permalink
Skip tests using parts of dulwich which are broken on PyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Feb 27, 2021
1 parent 3395213 commit 6724828
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/test_build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 3rd party
# stdlib
import platform

# 3rd party
import pytest
import southwark.repo
from apeye import URL
Expand All @@ -15,7 +16,8 @@

@pytest.mark.skipif(
PYPY and platform.system() == "Windows",
reason="Dulwich causes 'TypeError: os.scandir() doesn't support bytes path on Windows, use Unicode instead'",
reason=
"Dulwich causes 'TypeError: os.scandir() doesn't support bytes path on Windows, use Unicode instead'",
)
@pytest.mark.parametrize(
"username, repository", [
Expand Down
21 changes: 20 additions & 1 deletion tests/test_cli/test_release.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# stdlib
import platform
import re
from typing import TYPE_CHECKING, Callable, List, Optional

# 3rd party
from coincidence import check_file_output
import pytest
from coincidence.regressions import check_file_output
from consolekit.testing import CliRunner, Result
from domdf_python_tools.compat import PYPY
from domdf_python_tools.paths import in_directory
from pytest_regressions.file_regression import FileRegressionFixture
from southwark import get_tags
Expand Down Expand Up @@ -79,6 +82,14 @@ def do_test_release(
assert tags[m.group(1)] == f"v{expected_version}"


pypy_windows_dulwich = pytest.mark.skipif(
PYPY and platform.system() == "Windows",
reason=
"Dulwich causes 'TypeError: os.scandir() doesn't support bytes path on Windows, use Unicode instead'",
)


@pypy_windows_dulwich
def test_release_minor(temp_repo, file_regression: FileRegressionFixture):
do_test_release(
temp_repo,
Expand All @@ -88,6 +99,7 @@ def test_release_minor(temp_repo, file_regression: FileRegressionFixture):
)


@pypy_windows_dulwich
def test_release_major(temp_repo, file_regression: FileRegressionFixture):
do_test_release(
temp_repo,
Expand All @@ -97,6 +109,7 @@ def test_release_major(temp_repo, file_regression: FileRegressionFixture):
)


@pypy_windows_dulwich
def test_release_patch(temp_repo, file_regression: FileRegressionFixture):
do_test_release(
temp_repo,
Expand All @@ -106,6 +119,7 @@ def test_release_patch(temp_repo, file_regression: FileRegressionFixture):
)


@pypy_windows_dulwich
def test_release_version(temp_repo, file_regression: FileRegressionFixture):
do_test_release(
temp_repo,
Expand All @@ -116,6 +130,7 @@ def test_release_version(temp_repo, file_regression: FileRegressionFixture):
)


@pypy_windows_dulwich
def test_release_unclean(temp_repo, file_regression: FileRegressionFixture):
(temp_repo.path / "file.txt").write_clean("Hello World")
temp_repo.stage("file.txt")
Expand Down Expand Up @@ -188,6 +203,7 @@ def test_release_unclean(temp_repo, file_regression: FileRegressionFixture):
# bumper = Bumper(temp_repo.path, force=False)


@pypy_windows_dulwich
def test_release_minor_unclean_force(temp_repo, file_regression: FileRegressionFixture):
(temp_repo.path / "file.txt").write_clean("Hello World")
temp_repo.stage("file.txt")
Expand All @@ -201,6 +217,7 @@ def test_release_minor_unclean_force(temp_repo, file_regression: FileRegressionF
)


@pypy_windows_dulwich
def test_release_major_unclean_force(temp_repo, file_regression: FileRegressionFixture):
(temp_repo.path / "file.txt").write_clean("Hello World")
temp_repo.stage("file.txt")
Expand All @@ -214,6 +231,7 @@ def test_release_major_unclean_force(temp_repo, file_regression: FileRegressionF
)


@pypy_windows_dulwich
def test_release_patch_unclean_force(temp_repo, file_regression: FileRegressionFixture):
(temp_repo.path / "file.txt").write_clean("Hello World")
temp_repo.stage("file.txt")
Expand All @@ -227,6 +245,7 @@ def test_release_patch_unclean_force(temp_repo, file_regression: FileRegressionF
)


@pypy_windows_dulwich
def test_release_version_unclean_force(temp_repo, file_regression: FileRegressionFixture):
(temp_repo.path / "file.txt").write_clean("Hello World")
temp_repo.stage("file.txt")
Expand Down

0 comments on commit 6724828

Please sign in to comment.