That's because SQLAlchemy filters are one of the few places where == False
actually makes sense. Everywhere else you should not use it.
Add a # noqa
comment to the line and be done with it.
Or you can use sqlalchemy.sql.expression.false
:
from sqlalchemy.sql.expression import false
TestCase.obsoleted == false()
where false()
returns the right value for your session SQL dialect. There is a matching sqlalchemy.expression.true
.