コード例 #1
0
def test_dlclose():
    import _cffi_backend
    from re_python_pysrc import ffi
    lib = ffi.dlopen(extmod)
    ffi.dlclose(lib)
    e = py.test.raises(ffi.error, ffi.dlclose, lib)
    assert str(e.value).startswith("library '%s' is already closed" %
                                   (extmod, ))
    e = py.test.raises(ffi.error, getattr, lib, 'add42')
    assert str(e.value) == ("library '%s' has been closed" % (extmod, ))
コード例 #2
0
 def test_dlclose(self):
     import _cffi_backend
     self.fix_path()
     from re_python_pysrc import ffi
     lib = ffi.dlopen(self.extmod)
     ffi.dlclose(lib)
     e = raises(ffi.error, getattr, lib, 'add42')
     assert str(e.value) == ("library '%s' has been closed" %
                             (self.extmod, ))
     ffi.dlclose(lib)  # does not raise
コード例 #3
0
ファイル: test_re_python.py プロジェクト: Qointum/pypy
    def test_dlclose(self):
        import _cffi_backend
        from re_python_pysrc import ffi

        lib = ffi.dlopen(self.extmod)
        ffi.dlclose(lib)
        e = raises(ffi.error, ffi.dlclose, lib)
        assert str(e.value) == ("library '%s' is already closed" % (self.extmod,))
        e = raises(ffi.error, getattr, lib, "add42")
        assert str(e.value) == ("library '%s' has been closed" % (self.extmod,))
コード例 #4
0
ファイル: test_re_python.py プロジェクト: Piotrek321/Voice
def test_dlclose():
    import _cffi_backend
    from re_python_pysrc import ffi
    lib = ffi.dlopen(extmod)
    ffi.dlclose(lib)
    e = py.test.raises(ffi.error, ffi.dlclose, lib)
    assert str(e.value).startswith(
        "library '%s' is already closed" % (extmod,))
    e = py.test.raises(ffi.error, getattr, lib, 'add42')
    assert str(e.value) == (
        "library '%s' has been closed" % (extmod,))
コード例 #5
0
def test_dlclose():
    import _cffi_backend
    from re_python_pysrc import ffi
    lib = ffi.dlopen(extmod)
    ffi.dlclose(lib)
    if type(extmod) is not str:  # unicode, on python 2
        str_extmod = extmod.encode('utf-8')
    else:
        str_extmod = extmod
    e = py.test.raises(ffi.error, getattr, lib, 'add42')
    assert str(e.value) == ("library '%s' has been closed" % (str_extmod, ))
    ffi.dlclose(lib)  # does not raise
コード例 #6
0
def test_dlclose():
    import _cffi_backend
    from re_python_pysrc import ffi
    lib = ffi.dlopen(extmod)
    ffi.dlclose(lib)
    if type(extmod) is not str:   # unicode, on python 2
        str_extmod = extmod.encode('utf-8')
    else:
        str_extmod = extmod
    e = py.test.raises(ffi.error, getattr, lib, 'add42')
    assert str(e.value) == (
        "library '%s' has been closed" % (str_extmod,))
    ffi.dlclose(lib)   # does not raise