1
1
""" command line options, ini-file and conftest.py processing. """
2
2
from __future__ import absolute_import , division , print_function
3
3
import argparse
4
- import functools
5
4
import inspect
6
5
import shlex
7
6
import types
20
19
import _pytest .assertion
21
20
from pluggy import PluginManager , HookimplMarker , HookspecMarker
22
21
from _pytest ._code import ExceptionInfo , filter_traceback
22
+ from _pytest .compat import lru_cache
23
23
from _pytest .compat import safe_str
24
24
from .exceptions import UsageError , PrintHelp
25
25
from .findpaths import determine_setup , exists
@@ -894,6 +894,7 @@ def _getini(self, name):
894
894
assert type is None
895
895
return value
896
896
897
+ @lru_cache (maxsize = None )
897
898
def _getconftest_pathlist (self , name , path ):
898
899
try :
899
900
mod , relroots = self .pluginmanager ._rget_with_confmod (name , path )
@@ -908,10 +909,6 @@ def _getconftest_pathlist(self, name, path):
908
909
values .append (relroot )
909
910
return values
910
911
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
-
915
912
def _get_override_ini_value (self , name ):
916
913
value = None
917
914
# override_ini is a list of "ini=value" options
0 commit comments