Lee-W commented on PR #43978:
URL: https://github.com/apache/airflow/pull/43978#issuecomment-2484629746
> > Maybe add one then - following the same structure in `tests` as you have
for the source
>
> Sure. Since it's an abstract class, I'm thinking I'll have to create a
mock implementation for the test. I'll also need to mock `check_query_exists`
so that it returns `None` .Something like:
>
> ```python
> class LazySelectSequenceInstance(LazySelectSequence[Any]):
> ... # implement required methods
>
> @mock.patch("check_query_exists", lambda x, y: None):
> def test_lazy_select_sequence():
> lss = LazySelectSequenceInstance(...)
> assert bool(lss) == False
> ```
>
> Does this make sense?
Sounds reasonable. We already have a mock class here
https://github.com/apache/airflow/blob/f5abe506fc6ba22a8b8efb0d4784dd85eaa90af4/tests/serialization/test_serialized_objects.py#L170
probably we could do something similar here as well?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]