Move lru_cache wrapper to compat

Ref: https://github.com/pytest-dev/pytest/pull/4227#discussion_r228060373
This commit is contained in:
Daniel Hahler
2018-10-25 18:20:36 +02:00
parent f466105d66
commit 0dc6cb298e
2 changed files with 15 additions and 5 deletions

View File

@@ -417,3 +417,16 @@ class FuncargnamesCompatAttr(object):
def funcargnames(self):
""" alias attribute for ``fixturenames`` for pre-2.3 compatibility"""
return self.fixturenames
if six.PY2:
def lru_cache(*_, **__):
def dec(fn):
return fn
return dec
else:
from functools import lru_cache # noqa: F401