Skip to content

Commit f60899b

Browse files
committed
Skip two more problematic tests on Windows/PyPy
1 parent 336084c commit f60899b

File tree

5 files changed

+23
-30
lines changed

5 files changed

+23
-30
lines changed

tests/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,17 @@
1919
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
2020
# MA 02110-1301, USA.
2121
#
22+
23+
# stdlib
24+
import platform
25+
26+
# 3rd party
27+
import pytest
28+
from domdf_python_tools.compat import PYPY
29+
30+
_reason = "Dulwich causes 'TypeError: os.scandir() doesn't support bytes path on Windows, use Unicode instead'"
31+
32+
pypy_windows_dulwich = pytest.mark.skipif(
33+
PYPY and platform.system() == "Windows",
34+
reason=_reason,
35+
)

tests/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ coverage-pyver-pragma>=0.2.1
55
domdf-python-tools[testing]>=2.0.1
66
iniconfig!=1.1.0,>=1.0.1
77
lorem>=0.1.1
8-
pyreadline@ https://github.com/domdfcoding/3.10-Wheels/raw/936f0570b561f3cda0be94d93066a11c6fe782f1/pyreadline-2.0-py3-none-any.whl ; python_version == "3.10" and platform_system == "Windows"
98
pytest>=6.0.0
109
pytest-cov>=2.8.1
1110
pytest-randomly>=3.3.1

tests/test_build.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
# stdlib
2-
import platform
3-
41
# 3rd party
52
import pytest
63
import southwark.repo
74
from apeye import URL
8-
from domdf_python_tools.compat import PYPY
95
from dulwich.config import StackedConfig
106

117
# this package
128
from repo_helper.testing import builder_smoke_test
9+
from tests import pypy_windows_dulwich
1310

1411
GITHUB_COM = URL("https://github.com")
1512

1613

17-
@pytest.mark.skipif(
18-
PYPY and platform.system() == "Windows",
19-
reason=
20-
"Dulwich causes 'TypeError: os.scandir() doesn't support bytes path on Windows, use Unicode instead'",
21-
)
14+
@pypy_windows_dulwich
2215
@pytest.mark.parametrize(
2316
"username, repository", [
2417
("domdfcoding", "sphinx-toolbox"),

tests/test_cli/test_release.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# stdlib
2-
import platform
32
import re
43
from typing import TYPE_CHECKING, Callable, List, Optional
54

65
# 3rd party
7-
import pytest
86
from coincidence.regressions import check_file_regression
97
from consolekit.testing import CliRunner, Result
10-
from domdf_python_tools.compat import PYPY
118
from domdf_python_tools.paths import PathPlus, in_directory
129
from pytest_regressions.file_regression import FileRegressionFixture
1310
from southwark import get_tags
1411
from southwark.repo import Repo
1512

1613
# this package
1714
from repo_helper.cli.commands.release import major, minor, patch, release
15+
from tests import pypy_windows_dulwich
1816

1917
if TYPE_CHECKING:
2018
Command = Callable
@@ -112,13 +110,6 @@ def check_file(filename: PathPlus, extension: Optional[str] = None):
112110
assert tags[m.group(1)] == f"v{expected_version}"
113111

114112

115-
pypy_windows_dulwich = pytest.mark.skipif(
116-
PYPY and platform.system() == "Windows",
117-
reason=
118-
"Dulwich causes 'TypeError: os.scandir() doesn't support bytes path on Windows, use Unicode instead'",
119-
)
120-
121-
122113
@pypy_windows_dulwich
123114
def test_release_minor(temp_repo, file_regression: FileRegressionFixture):
124115
do_test_release(

tests/test_cli/test_show.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
# stdlib
2-
import platform
3-
41
# 3rd party
52
import pytest
6-
from coincidence import check_file_regression, min_version, not_pypy, only_version
3+
from coincidence.regressions import check_file_regression
4+
from coincidence.selectors import min_version, not_pypy, only_version
75
from consolekit.testing import CliRunner, Result
8-
from domdf_python_tools.compat import PYPY36
96
from domdf_python_tools.paths import PathPlus, in_directory
107
from pytest_regressions.file_regression import FileRegressionFixture
118

129
# this package
1310
from repo_helper.cli.commands import show
11+
from tests import pypy_windows_dulwich
1412

1513

14+
@pypy_windows_dulwich
1615
def test_version(tmp_repo, file_regression: FileRegressionFixture):
1716

1817
(tmp_repo / "repo_helper.yml").write_lines([
@@ -34,11 +33,7 @@ def test_version(tmp_repo, file_regression: FileRegressionFixture):
3433
result.check_stdout(file_regression)
3534

3635

37-
@pytest.mark.skipif(
38-
PYPY36 and platform.system() == "Windows",
39-
reason=
40-
"Dulwich causes 'TypeError: os.scandir() doesn't support bytes path on Windows, use Unicode instead'",
41-
)
36+
@pypy_windows_dulwich
4237
def test_changelog(tmp_repo, file_regression: FileRegressionFixture):
4338

4439
# TODO: -n/--entries
@@ -150,6 +145,7 @@ def test_requirements_no_pager(
150145
check_file_regression(result.stdout.rstrip(), file_regression, extension=".tree")
151146

152147

148+
@pypy_windows_dulwich
153149
def test_log(tmp_repo, file_regression: FileRegressionFixture):
154150

155151
# TODO: -n/--entries

0 commit comments

Comments
 (0)