Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
Create test_module_frame_restricted()
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Stinner committed Feb 15, 2010
1 parent e097fb9 commit 9f7870a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test_restricted.py
@@ -0,0 +1,6 @@
# Module used by test_module_frame_restricted() from tests.py

def _test_restricted(_getframe):
frame = _getframe()
return frame.f_restricted

8 changes: 8 additions & 0 deletions tests.py
Expand Up @@ -327,6 +327,14 @@ def test_frame_restricted():
else:
print "USE_CPYTHON_HACKS=False: disable exec_builtins and frame_restricted tests"

def test_module_frame_restricted():
from sys import _getframe
from test_restricted import _test_restricted

with createSandbox():
restricted = _test_restricted(_getframe)
assert restricted == True

def parseOptions():
from optparse import OptionParser

Expand Down

0 comments on commit 9f7870a

Please sign in to comment.