Skip to content

Commit f9c2074

Browse files
committed
Test backwards compatibility with released appdirs
Signed-off-by: Bernát Gábor <[email protected]>
1 parent 635ac97 commit f9c2074

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ docs =
4747
proselint>=0.10.2
4848
sphinx-autodoc-typehints>=1.12
4949
test =
50-
appdirs@https://github.com/ActiveState/appdirs/archive/8eacfa312d77aba28d483fbfb6f6fc54099622be.zip
50+
appdirs==1.4.4
5151
pytest>=6
5252
pytest-cov>=2.7
5353
pytest-mock>=3.6

tests/test_comp_with_appdirs.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ def test_has_backward_compatible_class() -> None:
2929
],
3030
)
3131
def test_compatibility(params: Dict[str, Any], func: str) -> None:
32-
if sys.platform == "darwin" and func == "user_log_dir":
33-
pytest.skip("`appdirs.user_log_dir` without appname produces NoneType error on macOS") # pragma: no cover
34-
if sys.platform == "darwin" and func == "site_config_dir":
35-
pytest.skip("`appdirs.site_config_dir` ignores the version argument on macOS") # pragma: no cover
32+
if sys.platform == "darwin":
33+
msg = { # pragma: no cover
34+
"user_log_dir": "without appname produces NoneType error",
35+
"site_config_dir": "ignores the version argument",
36+
"user_config_dir": "uses Library/Preferences instead Application Support",
37+
}
38+
if func in msg: # pragma: no cover
39+
pytest.skip(f"`appdirs.{func}` {msg[func]} on macOS") # pragma: no cover
3640

3741
new = getattr(platformdirs, func)(*params)
3842
old = getattr(appdirs, func)(*params)

0 commit comments

Comments
 (0)