File tree 3 files changed +9
-1
lines changed
3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,12 @@ Unreleased
25
25
- Changed an internal detail of how tomli is imported, so that tomli can use
26
26
coverage.py for their own test suite (`issue 1228 `_).
27
27
28
+ - Defend against an obscure possibility under code obfuscation, where a
29
+ function can have an argument called "self", but no local named "self"
30
+ (`pull request 1210 `_). Thanks, Ben Carlsson.
31
+
28
32
.. _issue 1228 : https://github.com/nedbat/coveragepy/issues/1228
33
+ .. _pull request 1210 : https://github.com/nedbat/coveragepy/pull/1210
29
34
30
35
31
36
.. _changes_60 :
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ Arcadiy Ivanov
20
20
Aron Griffis
21
21
Artem Dayneko
22
22
Arthur Deygin
23
+ Ben Carlsson
23
24
Ben Finney
24
25
Bernát Gábor
25
26
Bill Hart
Original file line number Diff line number Diff line change @@ -278,6 +278,8 @@ class test_something: # pylint: disable=unused-variable
278
278
assert get_qualname () is None
279
279
280
280
def test_bug_1210 (self ):
281
+ # Under pyarmor (an obfuscator), a function can have a "self" argument,
282
+ # but then not have a "self" local.
281
283
co = mock .Mock (co_name = "a_co_name" , co_argcount = 1 , co_varnames = ["self" ])
282
- frame = mock .Mock (f_code = co , f_locals = {})
284
+ frame = mock .Mock (f_code = co , f_locals = {})
283
285
assert qualname_from_frame (frame ) == "unittest.mock.a_co_name"
You can’t perform that action at this time.
0 commit comments