from couchbase.bucket import Bucket from couchbase.views.iterator import View from couchbase.tests.base import ApiImplementationMixin from couchbase.tests.importer import get_configured_classes class SyncImplMixin(ApiImplementationMixin): factory = Bucket viewfactory = View should_check_refcount = True configured_cases = get_configured_classes(SyncImplMixin) globals().update(configured_cases)
from couchbase.experimental import enable as enable_experimental enable_experimental() from couchbase.tests.base import ApiImplementationMixin, SkipTest try: import gevent except ImportError as e: raise SkipTest(e) from gcouchbase.connection import GConnection, GView from couchbase.tests.importer import get_configured_classes class GEventImplMixin(ApiImplementationMixin): factory = GConnection viewfactor = GView should_check_refcount = False skiplist = ('ConnectionIopsTest', 'LockmodeTest', 'ConnectionPipelineTest') configured_classes = get_configured_classes(GEventImplMixin, skiplist=skiplist) globals().update(configured_classes)
try: import gevent except ImportError as e: raise SkipTest(e) from gcouchbase.bucket import Bucket, GView from couchbase.tests.importer import get_configured_classes class GEventImplMixin(ApiImplementationMixin): factory = Bucket viewfactory = GView should_check_refcount = True def _implDtorHook(self): import gc if not self.cb.closed: waiter = self.cb._get_close_future() del self.cb gc.collect() if not waiter.wait(7): raise Exception("Not properly cleaned up!") skiplist = ('IopsTest', 'LockmodeTest', 'PipelineTest') configured_classes = get_configured_classes(GEventImplMixin, skiplist=skiplist) globals().update(configured_classes)
from couchbase.tests.importer import get_configured_classes from couchbase_ffi.connection import Connection from couchbase_ffi.result import ( MultiResult, OperationResult, Result, ValueResult, ObserveInfo) class ConfigMixin(ApiImplementationMixin): factory = Connection should_check_refcount = False cls_MultiResult = MultiResult cls_ValueResult = ValueResult cls_OperationResult = OperationResult cls_Result = Result cls_ObserveInfo = ObserveInfo configured_classes = get_configured_classes(ConfigMixin, implstr='_FFI') globals().update(configured_classes) # These are not yet implemented via cffi SKIP_NYI = ( ConnectionPipelineTest_FFI, ConnectionReplicaGetTest_FFI, ConnectionItemTest_FFI, ConverertSetTest_FFI, LockmodeTest_FFI ) for cls in SKIP_NYI: def _setup(*args):
import inspect import couchbase_ffi from couchbase_ffi.result import MultiResult from couchbase.tests.base import ApiImplementationMixin, SkipTest from couchbase.tests.importer import get_configured_classes from couchbase.bucket import Bucket class ConfigMixin(ApiImplementationMixin): factory = Bucket should_check_refcount = False cls_MultiResult = MultiResult configured_classes = get_configured_classes(ConfigMixin, implstr='_FFI') globals().update(configured_classes) # These are not yet implemented via cffi SKIP_NYI = [] for cls in SKIP_NYI: def _setup(*args): raise SkipTest("Not Implemented via FFI") def _teardown(*args): pass cls.setUp = _setup cls.tearDown = _teardown SKIP_NOT_SUPPORTED = ()