def pytest_funcarg__libudev(request): try: return _libudev.load_udev_library() except ImportError: pytest.skip('udev not available')
return getattr(libudev, self.name) @property def argument_types(self): return [_to_ctypes(a) for a in self.declaration.arguments] @property def return_type(self): return _to_ctypes(self.declaration.return_type) _FUNCTIONS = [ f for f in libudev.Unit.parse(libudev.LIBUDEV_H).functions if f.name.startswith('udev_') ] _LIBUDEV = _libudev.load_udev_library() _TEST_FUNCTIONS = [ LibudevFunction(f) for f in _FUNCTIONS if not _is_blacklisted(f) ] def test_arguments(): failures = [] for libudev_function in _TEST_FUNCTIONS: function = libudev_function.get_wrapper(_LIBUDEV) if function.argtypes != libudev_function.argument_types: failures.append(libudev_function.name) assert failures == []
def get_wrapper(self, libudev): return getattr(libudev, self.name) @property def argument_types(self): return [_to_ctypes(a) for a in self.declaration.arguments] @property def return_type(self): return _to_ctypes(self.declaration.return_type) _FUNCTIONS = [ f for f in libudev.Unit.parse(libudev.LIBUDEV_H).functions if f.name.startswith('udev_') ] _LIBUDEV = _libudev.load_udev_library() _TEST_FUNCTIONS = [ LibudevFunction(f) for f in _FUNCTIONS if not _is_blacklisted(f) ] def test_arguments(): failures = [] for libudev_function in _TEST_FUNCTIONS: function = libudev_function.get_wrapper(_LIBUDEV) if function.argtypes != libudev_function.argument_types: failures.append(libudev_function.name) assert failures == []
def __init__(self): """ Create a new context. """ self._libudev = load_udev_library() self._as_parameter_ = self._libudev.udev_new()