Skip to content

Commit 9a5bcb9

Browse files
committed
style: clean up unused imports and add spacing for readability for test files
1 parent 1a342b3 commit 9a5bcb9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

tests/conftest.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
from functools import wraps
66

77
from varname import core
8-
from varname.ignore import IgnoreList
8+
# from varname.ignore import IgnoreList
99

1010
import pytest
1111
from varname import config, ignore
1212

13+
1314
@pytest.fixture
1415
def no_getframe():
1516
"""
@@ -26,6 +27,7 @@ def getframe(_context):
2627
finally:
2728
sys._getframe = orig_getframe
2829

30+
2931
@pytest.fixture
3032
def no_get_node_by_frame():
3133
"""
@@ -42,6 +44,7 @@ def get_node_by_frame(frame):
4244
finally:
4345
core.get_node_by_frame = orig_get_node_by_frame
4446

47+
4548
@pytest.fixture
4649
def no_pure_eval():
4750
sys.modules['pure_eval'] = None
@@ -50,6 +53,7 @@ def no_pure_eval():
5053
finally:
5154
del sys.modules['pure_eval']
5255

56+
5357
@pytest.fixture
5458
def enable_debug():
5559
config.debug = True
@@ -58,6 +62,7 @@ def enable_debug():
5862
finally:
5963
config.debug = False
6064

65+
6166
@pytest.fixture
6267
def frame_matches_module_by_ignore_id_false():
6368
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():
6772
finally:
6873
ignore.frame_matches_module_by_ignore_id = orig_frame_matches_module_by_ignore_id
6974

75+
7076
def run_async(coro):
7177
if sys.version_info < (3, 7):
7278
loop = asyncio.get_event_loop()
@@ -92,12 +98,14 @@ def module_from_source(name, source, tmp_path):
9298
spec.loader.exec_module(module)
9399
return module
94100

101+
95102
def decor(func):
96103
"""Decorator just for test purpose"""
97104
def wrapper(*args, **kwargs):
98105
return func(*args, **kwargs)
99106
return wrapper
100107

108+
101109
def decor_wraps(func):
102110
@wraps(func)
103111
def wrapper(*args, **kwargs):

tests/named_expr.py

+2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
from varname import varname
44

5+
56
def function():
67
return varname()
78

9+
810
a = [b := function(), c := function()]

0 commit comments

Comments
 (0)