Permalink
Browse files

Create test_module_frame_restricted()

  • Loading branch information...
1 parent e097fb9 commit 9f7870adba6f40b8b193f596fedf658fdca88175 Victor Stinner committed Feb 15, 2010
Showing with 14 additions and 0 deletions.
  1. +6 −0 test_restricted.py
  2. +8 −0 tests.py
View
@@ -0,0 +1,6 @@
+# Module used by test_module_frame_restricted() from tests.py
+
+def _test_restricted(_getframe):
+ frame = _getframe()
+ return frame.f_restricted
+
View
@@ -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

0 comments on commit 9f7870a

Please sign in to comment.