From 265739e9a38f87d4d29c050e46221f17c9a62852 Mon Sep 17 00:00:00 2001 From: Richard Kjerstadius Date: Sat, 23 Feb 2019 01:07:10 +0100 Subject: [PATCH] Pass match rather than pattern argument to files() The pattern argument to listdir() has been deprecated in favor of the match argument. They don't function in the exact same way as match expects a callable that will be used for matching. --- tests/test_distribution.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_distribution.py b/tests/test_distribution.py index 12e5ab8..368e933 100644 --- a/tests/test_distribution.py +++ b/tests/test_distribution.py @@ -2,7 +2,7 @@ import os import pytest -from path import Path +from path import Path, matchers DIST_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../dist')) @@ -18,7 +18,7 @@ def _check_ninja_install(virtualenv): @pytest.mark.skipif(not Path(DIST_DIR).exists(), reason="dist directory does not exist") def test_source_distribution(virtualenv): - sdists = Path(DIST_DIR).files(pattern="*.tar.gz") + sdists = Path(DIST_DIR).files(match=matchers.CaseInsensitive("*.tar.gz")) if not sdists: pytest.skip("no source distribution available") assert len(sdists) == 1 @@ -32,7 +32,7 @@ def test_source_distribution(virtualenv): @pytest.mark.skipif(not Path(DIST_DIR).exists(), reason="dist directory does not exist") def test_wheel(virtualenv): - wheels = Path(DIST_DIR).files(pattern="*.whl") + wheels = Path(DIST_DIR).files(match=matchers.CaseInsensitive("*.whl")) if not wheels: pytest.skip("no wheel available") assert len(wheels) == 1