self = <swh.scheduler.tests.test_scheduler.TestScheduler object at 0x7f198cf6c7f0>
swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f198cf6c9e8>
def test_interface(self, swh_scheduler):
"""Checks all methods of SchedulerInterface are implemented by this
backend, and that they have the same signature."""
# Create an instance of the protocol (which cannot be instantiated
# directly, so this creates a subclass, then instantiates it)
interface = type("_", (SchedulerInterface,), {})()
assert "create_task_type" in dir(interface)
missing_methods = []
for meth_name in dir(interface):
if meth_name.startswith("_"):
continue
interface_meth = getattr(interface, meth_name)
try:
concrete_meth = getattr(swh_scheduler, meth_name)
except AttributeError:
if not getattr(interface_meth, "deprecated_endpoint", False):
# The backend is missing a (non-deprecated) endpoint
missing_methods.append(meth_name)
continue
expected_signature = inspect.signature(interface_meth)
actual_signature = inspect.signature(concrete_meth)
> assert expected_signature == actual_signature, meth_name
E AssertionError: origin_visit_info_get
E assert <Signature (u...it_type: str)> == <Signature (u...fo, NoneType]>
E +<Signature (url: str, visit_type: str)>
E -<Signature (url: str, visit_type: str) -> Union[swh.scheduler.model.OriginVisitInfo, NoneType]>
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_scheduler.py:60: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jan 12 2021, 12:17 PM