Skip to content

Commit

Permalink
Pass match rather than pattern argument to files()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kjerstadius committed Feb 23, 2019
1 parent 4e0c64f commit 265739e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 265739e

Please sign in to comment.