Ben Muller
07/01/2021, 5:47 AMtask
with arguments?
I want to test the functions logic but unfortunately when pytest
imports the function it is calling the decorators logic for the result=
argument, which calls an external dependancy.
I have tried to mock the task decorator but I cant seem to crack it.Aiden Price
07/01/2021, 6:09 AMresult = mytask.run()
Ben Muller
07/01/2021, 7:30 AMBen Muller
07/01/2021, 7:30 AMKevin Kho
Zanie
Ben Muller
07/01/2021, 7:36 PM@task(result=Backup.bucket()
where Backup.bucket just returns an S3Result object. I have tried mocking that out, but from my investigation it appears as though decorators mocking works differently and I couldn't manage to get it working.Ben Muller
07/01/2021, 7:40 PMBen Muller
07/01/2021, 7:42 PMBen Muller
07/01/2021, 7:43 PM@task
decorator. At first it didn't seem like the best approach, but it has the added benefit of now the common tasks can be shared between flows more easily @ZanieZanie
Zanie
Backup.bucket()
implementationBen Muller
07/01/2021, 8:45 PM