Skip to content

Commit

Permalink
- apply simplification suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Oct 4, 2024
1 parent abc32e4 commit 185e0fa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/zope/interface/common/tests/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def test_UserString(self):
add_abc_interface_tests(TestVerifyClass, collections.ISet.__module__)


def _get_FrameLocalsProxy():
return type(sys._getframe().f_locals)


class TestVerifyObject(VerifyObjectMixin,
TestVerifyClass):
CONSTRUCTORS = {
Expand Down Expand Up @@ -130,11 +134,8 @@ class TestVerifyObject(VerifyObjectMixin,
}
if sys.version_info >= (3, 13):
def FrameLocalsProxy_constructor():
FrameLocalsProxy = type([sys._getframe().f_locals for x in
range(1)][0])
return FrameLocalsProxy(sys._getframe())
FrameLocalsProxy = type([sys._getframe().f_locals for x in
range(1)][0])
return _get_FrameLocalsProxy()(sys._getframe())
FrameLocalsProxy = _get_FrameLocalsProxy()
CONSTRUCTORS[FrameLocalsProxy] = FrameLocalsProxy_constructor

UNVERIFIABLE_RO = {
Expand Down

0 comments on commit 185e0fa

Please sign in to comment.