Hi, I'm writing an integration for Metaflow and ha...
# dev-metaflow
b
Hi, I'm writing an integration for Metaflow and have some test Flows. My coverage is failing when I include the test Flows, and I think it's because Metaflow is enabling coverage. I see there is a
--coverage
flag. Is there a way to disable coverage for these test Flows?
1
a
it is supposed to be off by default however i wonder if the actual logic is a little more magical (judging by this ), do you remember @ancient-application-36103 ?
s
it is enabled if you run it with
coverage run
@big-stone-5971 how do you run your test flows?
b
I think we're running as
Copy code
coverage run flow.py --no-pylint run
I wonder if that's equivalent as doing
Copy code
python flow.py --coverage --no-pylint run
It sounds like it is... Can I explicitly disable coverage for just the test Flows? I still want to run the tests, just not enable coverage.
s
could you run them as
python flow.py run
? (not using
coverage
)
b
I think our testing harness runs coverage automatically. I don't have control over the harness. I can only specify parameters after
Copy code
coverage run --rcfile {conf}
s
hmm, tricky. The assumption has been that if you run with
coverage
then you want coverage enabled. We could provide an escape hatch in future versions of Metaflow
I don't know if this workaround works in your case, but you can try adding
Copy code
import sys
sys.modules.pop('coverage', None)
at the top of your flow module
it should make sure that
--coverage
is not added
b
Thanks for adding the issue Ville! I misspoke yesterday, but I think you got it in the issue. We don't want to disable coverage altogether, we just want to run line coverage with
branch=False
!
👍 1
a
I submitted a POC pr for this issue: https://github.com/Netflix/metaflow/pull/653 We are using it internally now and it seems to solve our problems.
👍 1
a
@average-lizard-41143 let me know when you would like us to start the review.
a
marked it ready for review.
👍 1
s
just closing the loop on this one - your PR got merged and released. Hopefully it fixes the issue on your side
1