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, ))
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
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,))
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,))
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
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