11""" command line options, ini-file and conftest.py processing. """
22from __future__ import absolute_import , division , print_function
33import argparse
4- import functools
54import inspect
65import shlex
76import types
2019import _pytest .assertion
2120from pluggy import PluginManager , HookimplMarker , HookspecMarker
2221from _pytest ._code import ExceptionInfo , filter_traceback
22+ from _pytest .compat import lru_cache
2323from _pytest .compat import safe_str
2424from .exceptions import UsageError , PrintHelp
2525from .findpaths import determine_setup , exists
@@ -894,6 +894,7 @@ def _getini(self, name):
894894 assert type is None
895895 return value
896896
897+ @lru_cache (maxsize = None )
897898 def _getconftest_pathlist (self , name , path ):
898899 try :
899900 mod , relroots = self .pluginmanager ._rget_with_confmod (name , path )
@@ -908,10 +909,6 @@ def _getconftest_pathlist(self, name, path):
908909 values .append (relroot )
909910 return values
910911
911- if six .PY3 :
912- # once we drop Python 2, please change this to use the normal decorator syntax (#4227)
913- _getconftest_pathlist = functools .lru_cache (maxsize = None )(_getconftest_pathlist )
914-
915912 def _get_override_ini_value (self , name ):
916913 value = None
917914 # override_ini is a list of "ini=value" options
0 commit comments