Skip to content

Commit 265739e

Browse files
committed
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.
1 parent 4e0c64f commit 265739e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_distribution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import pytest
44

5-
from path import Path
5+
from path import Path, matchers
66

77
DIST_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../dist'))
88

@@ -18,7 +18,7 @@ def _check_ninja_install(virtualenv):
1818

1919
@pytest.mark.skipif(not Path(DIST_DIR).exists(), reason="dist directory does not exist")
2020
def test_source_distribution(virtualenv):
21-
sdists = Path(DIST_DIR).files(pattern="*.tar.gz")
21+
sdists = Path(DIST_DIR).files(match=matchers.CaseInsensitive("*.tar.gz"))
2222
if not sdists:
2323
pytest.skip("no source distribution available")
2424
assert len(sdists) == 1
@@ -32,7 +32,7 @@ def test_source_distribution(virtualenv):
3232

3333
@pytest.mark.skipif(not Path(DIST_DIR).exists(), reason="dist directory does not exist")
3434
def test_wheel(virtualenv):
35-
wheels = Path(DIST_DIR).files(pattern="*.whl")
35+
wheels = Path(DIST_DIR).files(match=matchers.CaseInsensitive("*.whl"))
3636
if not wheels:
3737
pytest.skip("no wheel available")
3838
assert len(wheels) == 1

0 commit comments

Comments
 (0)