From 3e9b02bb253de93885aeada64b60fdccf412fe20 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 4 Jun 2021 06:50:27 -0400 Subject: test: hide check_coverage source in pytest tracebacks The code for the helper is uninteresting and long, and only makes it harder to see what is going wrong. Hide it. https://docs.pytest.org/en/latest/example/simple.html#writing-well-integrated-assertion-helpers --- tests/coveragetest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/coveragetest.py b/tests/coveragetest.py index 287b585d..80e8853a 100644 --- a/tests/coveragetest.py +++ b/tests/coveragetest.py @@ -133,6 +133,8 @@ class CoverageTest( Returns the Coverage object, in case you want to poke at it some more. """ + __tracebackhide__ = True # pytest, please don't show me this function. + # We write the code into a file so that we can import it. # Coverage.py wants to deal with things as modules with file names. modname = self.get_module_name() -- cgit v1.2.1