Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ids=(["MultiDict", "CIMultiDict"] if USE_CYTHON else [])
+ ["PyMultiDict", "PyCIMultiDict"],
)
def cls(request):
return request.param
import gc
import sys
import pytest
from multidict._compat import USE_CYTHON
from multidict._multidict_py import istr as _istr # noqa: E402
if USE_CYTHON:
from multidict._multidict import istr
IMPLEMENTATION = getattr(sys, "implementation") # to suppress mypy error
class IStrMixin:
cls = NotImplemented
def test_ctor(self):
s = self.cls()
assert "" == s
def test_ctor_str(self):
s = self.cls("aBcD")
ids=(["MultiDict", "CIMultiDict"] if USE_CYTHON else [])
+ ["PyMultiDict", "PyCIMultiDict"],
)
def cls(request):
return request.param
ids=(["MultiDict", "CIMultiDict"] if USE_CYTHON else [])
+ ["PyMultiDict", "PyCIMultiDict"],
)
def cls(request):
return request.param
import pytest
from multidict._compat import USE_CYTHON
from multidict._multidict_py import CIMultiDict as _CIMultiDict
from multidict._multidict_py import MultiDict as _MultiDict # noqa: E402
from multidict._multidict_py import getversion as _getversion
if USE_CYTHON:
from multidict._multidict import MultiDict, CIMultiDict, getversion
class VersionMixin:
cls = NotImplemented
def getver(self, md):
raise NotImplementedError
def test_getversion_bad_param(self):
with pytest.raises(TypeError):
self.getver(1)
def test_ctor(self):
m1 = self.cls()
v1 = self.getver(m1)
def generate():
if not USE_CYTHON:
raise RuntimeError("Cython is required")
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
for name in ("MultiDict", "CIMultiDict", "PyMultiDict", "PyCIMultiDict"):
write(name, proto)
ids=(["MultiDictProxy", "CIMultiDictProxy"] if USE_CYTHON else [])
+ ["PyMultiDictProxy", "PyCIMultiDictProxy"],
)
def proxy_classes(request):
return request.param