TGViewer
Находки в опенсорсе Находки в опенсорсе @opensource_findings · 12.7K subscribers
Post #376 2.03K
​​Conditional coverage based on any rules you define!

Some project have different parts that relies on different environments:

- #python version, some code is only executed on specific versions and ignored on others
- OS version, some code might be Windows, Mac, or Linux only
- External packages, some code is only executed when some 3rd party package is installed

Current best practice is to use # pragma: no cover for this places in your project.

coverage-conditional-plugin allows to use configurable pragmas that include code to the coverage if some condition evaluates to true, and fallback to ignoring this code when condition is false.

Read the announcing post: https://sobolevn.me/2020/02/conditional-coverage

Go star this repo: https://github.com/wemake-services/coverage-conditional-plugin
More from @opensource_findings
  1. Oct 16, 2026Платформа для agentic разработки Коллеги из GitVerse сегодня выкатили новое большое обновл…
  2. Oct 9, 2026Post #990
  3. Sep 28, 2026Еще анонсы докладов на бесплатную конференцию 17 октября в НН Регистрация: https://itgorky…
  4. Sep 25, 2026Монадические выражения в Python. Наконец-то! Продолжаем разговор про интересные PEPы. Пого…
  5. Sep 15, 2026PEPы в Python окончательно вышли из-под контроля Давайте посмотрим, что происходит с ПЕПам…
  6. Sep 10, 2026Большая бесплатная конференция в Нижнем Новгороде 17 октября Регистрация: https://itgorky.…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →