5
5
from functools import wraps
6
6
7
7
from varname import core
8
- from varname .ignore import IgnoreList
8
+ # from varname.ignore import IgnoreList
9
9
10
10
import pytest
11
11
from varname import config , ignore
12
12
13
+
13
14
@pytest .fixture
14
15
def no_getframe ():
15
16
"""
@@ -26,6 +27,7 @@ def getframe(_context):
26
27
finally :
27
28
sys ._getframe = orig_getframe
28
29
30
+
29
31
@pytest .fixture
30
32
def no_get_node_by_frame ():
31
33
"""
@@ -42,6 +44,7 @@ def get_node_by_frame(frame):
42
44
finally :
43
45
core .get_node_by_frame = orig_get_node_by_frame
44
46
47
+
45
48
@pytest .fixture
46
49
def no_pure_eval ():
47
50
sys .modules ['pure_eval' ] = None
@@ -50,6 +53,7 @@ def no_pure_eval():
50
53
finally :
51
54
del sys .modules ['pure_eval' ]
52
55
56
+
53
57
@pytest .fixture
54
58
def enable_debug ():
55
59
config .debug = True
@@ -58,6 +62,7 @@ def enable_debug():
58
62
finally :
59
63
config .debug = False
60
64
65
+
61
66
@pytest .fixture
62
67
def frame_matches_module_by_ignore_id_false ():
63
68
orig_frame_matches_module_by_ignore_id = ignore .frame_matches_module_by_ignore_id
@@ -67,6 +72,7 @@ def frame_matches_module_by_ignore_id_false():
67
72
finally :
68
73
ignore .frame_matches_module_by_ignore_id = orig_frame_matches_module_by_ignore_id
69
74
75
+
70
76
def run_async (coro ):
71
77
if sys .version_info < (3 , 7 ):
72
78
loop = asyncio .get_event_loop ()
@@ -92,12 +98,14 @@ def module_from_source(name, source, tmp_path):
92
98
spec .loader .exec_module (module )
93
99
return module
94
100
101
+
95
102
def decor (func ):
96
103
"""Decorator just for test purpose"""
97
104
def wrapper (* args , ** kwargs ):
98
105
return func (* args , ** kwargs )
99
106
return wrapper
100
107
108
+
101
109
def decor_wraps (func ):
102
110
@wraps (func )
103
111
def wrapper (* args , ** kwargs ):
0 commit comments