diff options
author | glacials <qhiiyr@gmail.com> | 2021-08-06 14:17:26 -0700 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-06 16:49:01 -0400 |
commit | 19545b7d78fb91a82088517681e20cf4ffcd8c63 (patch) | |
tree | 3012ec70fdedebf2604b010c22c56dbefe9f0ba6 /tests/test_context.py | |
parent | 613446ca9da592c6925329b869b9ef785d83f76e (diff) | |
download | python-coveragepy-git-19545b7d78fb91a82088517681e20cf4ffcd8c63.tar.gz |
Fix an incompatibility with pyarmor
Diffstat (limited to 'tests/test_context.py')
-rw-r--r-- | tests/test_context.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_context.py b/tests/test_context.py index 3f80803b..de972819 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -5,6 +5,7 @@ import inspect import os.path +from unittest import mock import coverage from coverage.context import qualname_from_frame @@ -275,3 +276,8 @@ class QualnameTest(CoverageTest): # A class with a name like a function shouldn't confuse qualname_from_frame. class test_something: # pylint: disable=unused-variable assert get_qualname() is None + + def test_bug_1210(self): + co = mock.Mock(co_name="a_co_name", co_argcount=1, co_varnames=["self"]) + frame = mock.Mock(f_code = co, f_locals={}) + assert qualname_from_frame(frame) == "unittest.mock.a_co_name" |