def test_task_call_with_self_succeeds(): import dataclasses @dataclasses.dataclass class TestClass: count: int def increment(self): self.count = self.count + 1 seconds_task = task(TestClass.increment, target="{{task_slug}}_{{map_index}}", result=LocalResult()) initial = TestClass(count=0) with Flow("test") as flow: seconds_task(initial) assert flow.run().is_successful()
def test_class_instantiation_raises_helpful_warning_for_unsupported_callables( self): with pytest.raises(ValueError, match="This function can not be inspected"): task(zip)