what is coverage? (intermediate) anthony explains

  Рет қаралды 4,055

anthonywritescode

anthonywritescode

Жыл бұрын

today I talk about `coverage` -- a useful tool to help you figure out whether your code is actually tested!
playlist: • anthony explains
==========
twitch: / anthonywritescode
dicsord: / discord
twitter: / codewithanthony
github: github.com/asottile
stream github: github.com/anthonywritescode
I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!

Пікірлер: 24
@mrswats
@mrswats Жыл бұрын
3:01 My favourite moment of the video
@Aman26758
@Aman26758 Жыл бұрын
You are simply awesome
@l4m5
@l4m5 Жыл бұрын
exactly what i needed
@bhaveshverma8629
@bhaveshverma8629 Жыл бұрын
Woh nice one. I also learn even i am not from Python background
@l4m5
@l4m5 Жыл бұрын
please would you mind going over the extension part of coverage "ctracer/"
@anthonywritescode
@anthonywritescode Жыл бұрын
anything specific? as I said in the video it's basically a settrace handler
@mfeickert07
@mfeickert07 Жыл бұрын
Do you have a "anthony explains" video about packaging monorepos? I thought you did, but when checking the explains repo I don't see anything from a quick ctrl+f. Some people in my org are moving from "one repo per micro service to a single repo with each service as a subdirectory" and are struggling a bit, so I was hoping to send them a video.
@anthonywritescode
@anthonywritescode Жыл бұрын
heh, I don't really like monorepos personally and haven't worked in a place where they went well -- I have a video about all-repos (was given as a talk) which is sorta the opposite (how I manage many-repos)
@mfeickert07
@mfeickert07 Жыл бұрын
@@anthonywritescode Yeah I don't use monorepos either, for what I assume are similar reasons to you. But I figured as you've shown multiple ways of doing things on the channel before, some of them you warn in the video that you don't like or don't personally use, that I'd check if I had missed it somewhere. Thanks for verifying I didn't!
@amir.hessam
@amir.hessam Жыл бұрын
​ @anthonywritescode is there any specific reason not using `pytest-cov` plugin which is essentially using `coverage` in the back? just wondering your thoughts. I personally use it as `python -m pytest --cov=src --cov-report=term --cov-report=html --cov-report=xml --cov-config=.coveragerc --tb=short -ra -v` in one line
@anthonywritescode
@anthonywritescode Жыл бұрын
I've got another video recorded about why I don't use pytest-cov -- the tl;dr is it's fragile and you don't need it and doing everything "in one line" to me is a big minus rather than a plus
@lycantropos
@lycantropos Жыл бұрын
from my experience explicitly calling coverage (with all options available) is better than having it turned on implicitly on each test run, also tests debugging in my IDE-of-choice (PyCharm) didn't work well with `pytest-cov` some time ago, don't know about current state of things
@jhg12989
@jhg12989 Жыл бұрын
@@anthonywritescode What's the other recorded video? Has it been released yet? ;()
@jfk1337
@jfk1337 Жыл бұрын
Hi anthony do you know about hatch from pypa? Is this an alternative to use for poetry?
@anthonywritescode
@anthonywritescode Жыл бұрын
I know it exists, but I don't know whether it's good or not because I have not tried it
@numeritos1799
@numeritos1799 Жыл бұрын
Is going for 100% coverage something normal to do? In my company we usually go for something like 90%. It's application code though, not libraries.
@anthonywritescode
@anthonywritescode Жыл бұрын
I am for 100 -- it's so hard to "not decrease coverage" when it's non-100 (since a refactor / improvement / deletion may necessarily decrease coverage but is a good change). selectively `no cover`ing things to get there is one way. you could also track "uncovered lines" instead of the covered / uncovered ratio as a better improvable metric, but I've only ever seen this done once and the tooling doesn't seem to support it natively
@numeritos1799
@numeritos1799 Жыл бұрын
@@anthonywritescode Hm, makes sense, thanks for the thoughtful answer
@yudhiesh1997
@yudhiesh1997 Жыл бұрын
Do you know how to generate coverage reports for cookie cutter templates?
@anthonywritescode
@anthonywritescode Жыл бұрын
I'm not sure what you mean? are you testing a template or are you looking to template a way to get reports?
@yudhiesh1997
@yudhiesh1997 Жыл бұрын
@@anthonywritescode oops sorry, I’m testing a template.
@anthonywritescode
@anthonywritescode Жыл бұрын
I'm not sure code coverage really applies there? it's just codegen right?
@abhishekminz123
@abhishekminz123 Жыл бұрын
Work it in Windows 11
@amir.hessam
@amir.hessam Жыл бұрын
First comment as always
don't make images of code / text!  (beginner)  -- anthony explains #481
2:32
anthonywritescode
Рет қаралды 3,8 М.
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 63 МЛН
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 82 МЛН
Property-Based Testing In Python: Hypothesis is AWESOME
21:23
ArjanCodes
Рет қаралды 49 М.
py-spy saved our python 3.11 rollout (intermediate) anthony explains #568
13:48
The Zsh Shell Tricks I Wish I'd Known Earlier: Boost Terminal Productivity
18:41
pesky reDOS and python 3.11 (intermediate) anthony explains #563
11:23
anthonywritescode
Рет қаралды 3,6 М.
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 157 М.
~/.dotfiles in 100 Seconds
13:54
Fireship
Рет қаралды 412 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 344 М.
Какой ноутбук взять для учёбы? #msi #rtx4090 #laptop #юмор #игровой #apple #shorts
0:18
Ноутбук за 20\40\60 тысяч рублей
42:36
Ремонтяш
Рет қаралды 406 М.
#samsung #retrophone #nostalgia #x100
0:14
mobijunk
Рет қаралды 11 МЛН