diff --git a/pytest_flakes.py b/pytest_flakes.py index 77c7028..58fabe0 100644 --- a/pytest_flakes.py +++ b/pytest_flakes.py @@ -6,6 +6,7 @@ import pytest import sys import tokenize +import fnmatch PYTEST_GTE_7 = hasattr(pytest, 'version_tuple') and pytest.version_tuple >= (7, 0) @@ -148,7 +149,7 @@ def __init__(self, ignorelines, coderex=re.compile(r"[EW]\d\d\d")): def __call__(self, path): l = set() for (glob, ignlist) in self.ignores: - if not glob or path.glob(glob): + if not glob or fnmatch.fnmatch(path, glob): if ignlist is None: return None l.update(set(ignlist))