Fixed #2121 Use `py.path`s fnmatch. This fixes an issue where

python_files handled properly when rewriting assertions.
This commit is contained in:
Andreas Pelme 2016-12-17 14:21:44 +01:00
parent ac9c8fcdab
commit 021e843427
1 changed files with 1 additions and 2 deletions

View File

@ -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