예제 #1
0
def test_simple_dir_name():
    simple = isolate.Isolate((os.path.dirname(__file__), 'isolate_simple'))
    f = simple.f
    res = f(1, 2)
    assert res == 3
    res = f(2, 3)
    assert res == 5
    isolate.close_isolate(simple)
예제 #2
0
def test_simple():
    simple = isolate.Isolate('pypy.tool.test.isolate_simple')
    f = simple.f
    res = f(1, 2)
    assert res == 3
    res = f(2, 3)
    assert res == 5
    isolate.close_isolate(simple)
예제 #3
0
파일: genc.py 프로젝트: xx312022850/pypy
 def _import_module(self, isolated=False):
     if self._module is not None:
         return self._module
     assert self._compiled
     assert not self._module
     self._make_wrapper_module()
     if not isolated:
         mod = ModuleWithCleanup(self._module_path.pyimport())
     else:
         mod = isolate.Isolate((str(self._module_path.dirpath()),
                                self._module_path.purebasename))
     self._module = mod
     return mod
예제 #4
0
def test_init():
    simple = isolate.Isolate('pypy.tool.test.isolate_simple')
    isolate.close_isolate(simple)
예제 #5
0
def test_bomb():
    simple = isolate.Isolate('pypy.tool.test.isolate_simple')
    py.test.raises(EOFError, "simple.bomb()")
    isolate.close_isolate(simple)
예제 #6
0
def test_raising_fancy():
    simple = isolate.Isolate('pypy.tool.test.isolate_simple')
    py.test.raises(isolate.IsolateException, "simple.h()")
    isolate.close_isolate(simple)
예제 #7
0
def test_raising():
    simple = isolate.Isolate('pypy.tool.test.isolate_simple')
    py.test.raises(ValueError, "simple.g()")
    isolate.close_isolate(simple)
예제 #8
0
def test_init_dir_name():
    simple = isolate.Isolate((os.path.dirname(__file__), 'isolate_simple'))
    isolate.close_isolate(simple)