coveragepy icon indicating copy to clipboard operation
coveragepy copied to clipboard

Fix paths when running coverage from root

Open arthurio opened this issue 3 years ago • 1 comments

I'm running coverage from a docker image where my source code is at /. I couldn't figure out why the paths were all starting with / but not if I moved things in a subfolder (e.g. /subfolder). With the current implementation, RELATIVE_DIR would be equal to // instead of / because we suffix no matter what.

I tested this change manually in my docker image with [email protected] and coverage==6.0.2.

arthurio avatar Jun 14 '22 16:06 arthurio

The simple tests I added are heavily mocked... let me know if you can think of something better!

arthurio avatar Jun 14 '22 17:06 arthurio

Thanks. I see what you mean about the mocking, but i don't see a better way.

nedbat avatar Aug 06 '22 19:08 nedbat

This is now released as part of coverage 6.4.3.

nedbat avatar Aug 06 '22 20:08 nedbat