typeguard makes tests with motors fail
For example
__________________________________________ test_plotselect_and_global_cen ___________________________________________
session = <bliss.common.session.Session object at 0x7f52403c5dd0>
def test_plotselect_and_global_cen(session):
roby = getattr(setup_globals, "roby")
simul_counter = getattr(setup_globals, "sim_ct_gauss")
scans.plotselect(simul_counter)
> s = scans.ascan(roby, 0, .1, 5, 0, simul_counter, save=False)
tests/scans/test_cen_com.py:105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typeguard/__init__.py:809: in wrapper
check_argument_types(memo)
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typeguard/__init__.py:670: in check_argument_types
raise exc from None
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typeguard/__init__.py:668: in check_argument_types
check_type(description, value, expected_type, memo)
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typeguard/__init__.py:586: in check_type
check_protocol(argname, value, expected_type)
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typeguard/__init__.py:501: in check_protocol
if not issubclass(type(value), expected_type):
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/abc.py:143: in __subclasscheck__
return _abc_subclasscheck(cls, subclass)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
other = <class 'bliss.controllers.motors.mockup.MockupAxis'>
def _proto_hook(other):
if not cls.__dict__.get('_is_protocol', None):
return NotImplemented
if not getattr(cls, '_is_runtime_protocol', False):
if sys._getframe(2).f_globals['__name__'] in ['abc', 'functools']:
return NotImplemented
raise TypeError("Instance and class checks can only be used with"
" @runtime protocols")
if not _is_callable_members_only(cls):
if sys._getframe(2).f_globals['__name__'] in ['abc', 'functools']:
return NotImplemented
> raise TypeError("Protocols with non-method members"
" don't support issubclass()")
E TypeError: Protocols with non-method members don't support issubclass()
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typing_extensions.py:1507: TypeError
and another one
________________________________ test_nxw_ascan ________________________________
nexus_writer_config = {'session': <bliss.common.session.Session object at 0x7f0bf2ad1f90>, 'tmpdir': local('/tmp/pytest-of-denolf/pytest-23/test_nxw_ascan0'), 'writer': <PopenGreenlet at 0x7f0bf13794d0: _run>}
def test_nxw_ascan(nexus_writer_config):
> _test_nxw_ascan(**nexus_writer_config)
tests/nexus_writer/test_nxw_ascan.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/nexus_writer/helpers/nxw_test_utils.py:261: in inner
func(*args, **kwargs)
tests/nexus_writer/test_nxw_ascan.py:42: in _test_nxw_ascan
scan = scans.ascan(
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typeguard/__init__.py:809: in wrapper
check_argument_types(memo)
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typeguard/__init__.py:670: in check_argument_types
raise exc from None
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typeguard/__init__.py:668: in check_argument_types
check_type(description, value, expected_type, memo)
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typeguard/__init__.py:586: in check_type
check_protocol(argname, value, expected_type)
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typeguard/__init__.py:501: in check_protocol
if not issubclass(type(value), expected_type):
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/abc.py:143: in __subclasscheck__
return _abc_subclasscheck(cls, subclass)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
other = <class 'ObjectAlias'>
def _proto_hook(other):
if not cls.__dict__.get('_is_protocol', None):
return NotImplemented
if not getattr(cls, '_is_runtime_protocol', False):
if sys._getframe(2).f_globals['__name__'] in ['abc', 'functools']:
return NotImplemented
raise TypeError("Instance and class checks can only be used with"
" @runtime protocols")
if not _is_callable_members_only(cls):
if sys._getframe(2).f_globals['__name__'] in ['abc', 'functools']:
return NotImplemented
> raise TypeError("Protocols with non-method members"
" don't support issubclass()")
E TypeError: Protocols with non-method members don't support issubclass()
/data/id21/inhouse/wout/dev/virtualenvs/rnice8/bliss/py37/lib/python3.7/site-packages/typing_extensions.py:1507: TypeError
Edited by Wout De Nolf