id = Column(Integer, primary_key=True)
data = Column(String)
- # EXPECTED: Left hand assignment 'bs: "Set[B]"' not compatible with ORM mapped expression of type "Mapped[List[B]]" # noqa
+
bs: Set[B] = relationship(B, uselist=True, back_populates="a")
# EXPECTED: Left hand assignment 'another_bs: "Set[B]"' not compatible with ORM mapped expression of type "Mapped[B]" # noqa
id = Column(Integer, primary_key=True)
- # EXPECTED_MYPY: Unexpected keyword argument "wrong_arg" for "RelationshipProperty" # noqa
addresses: Mapped[List["Address"]] = relationship(
"Address", wrong_arg="imwrong"
)
args.append(path)
- return api.run(args)
+ result = api.run(args)
+ return result
return run
result = mypy_runner(path, use_plugin=use_plugin)
+ not_located = []
+
if expected_errors:
eq_(result[2], 1, msg=result)
):
break
else:
+ not_located.append(msg)
continue
del errors[idx]
+ if not_located:
+ print(f"Couldn't locate expected messages: {not_located}")
+ assert False, "expected messages not found, see stdout"
+
assert not errors, "errors remain: %s" % "\n".join(errors)
else: