File tree 3 files changed +18
-2
lines changed 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
# NOTE: This version needs to be manually maintained with the line_profiler
15
15
# __version__ for now.
16
- __version__ = '4.0.0 '
16
+ __version__ = '4.0.1 '
17
17
18
18
# Guard the import of cProfile such that 3.x people
19
19
# without lsprof can still use this script.
Original file line number Diff line number Diff line change 16
16
f'Has it been compiled? Underlying error is ex={ ex !r} '
17
17
)
18
18
19
- __version__ = '4.0.0 '
19
+ __version__ = '4.0.1 '
20
20
21
21
22
22
def load_ipython_extension (ip ):
Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ def g(x):
12
12
y = yield x + 10
13
13
yield y + 20
14
14
15
+ class C :
16
+ @classmethod
17
+ def c (self , value ):
18
+ print (value )
19
+ return 0
20
+
15
21
16
22
def test_init ():
17
23
lp = LineProfiler ()
@@ -86,3 +92,13 @@ def test_gen_decorator():
86
92
with pytest .raises (StopIteration ):
87
93
next (i )
88
94
assert profile .enable_count == 0
95
+
96
+ def test_classmethod_decorator ():
97
+ profile = LineProfiler ()
98
+ c_wrapped = profile (C .c )
99
+ assert c_wrapped .__name__ == 'c'
100
+ assert profile .enable_count == 0
101
+ val = c_wrapped ('test' )
102
+ assert profile .enable_count == 0
103
+ assert val == C .c ('test' )
104
+ assert profile .enable_count == 0
You can’t perform that action at this time.
0 commit comments