Fixed #2121 Use `py.path`s fnmatch. This fixes an issue where
python_files handled properly when rewriting assertions.
This commit is contained in:
parent
ac9c8fcdab
commit
021e843427
|
@ -11,7 +11,6 @@ import re
|
||||||
import struct
|
import struct
|
||||||
import sys
|
import sys
|
||||||
import types
|
import types
|
||||||
from fnmatch import fnmatch
|
|
||||||
|
|
||||||
import py
|
import py
|
||||||
from _pytest.assertion import util
|
from _pytest.assertion import util
|
||||||
|
@ -167,7 +166,7 @@ class AssertionRewritingHook(object):
|
||||||
# latter might trigger an import to fnmatch.fnmatch
|
# latter might trigger an import to fnmatch.fnmatch
|
||||||
# internally, which would cause this method to be
|
# internally, which would cause this method to be
|
||||||
# called recursively
|
# called recursively
|
||||||
if fnmatch(fn_pypath.basename, pat):
|
if fn_pypath.fnmatch(pat):
|
||||||
state.trace("matched test file %r" % (fn,))
|
state.trace("matched test file %r" % (fn,))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue