pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Incomplete abstract class no longer logs an error

Open Dreamsorcerer opened this issue 5 months ago • 16 comments

We have this test in aiohttp:

def test_testcase_no_app(
    testdir: pytest.Testdir, loop: asyncio.AbstractEventLoop
) -> None:
    testdir.makepyfile(
        """
        from aiohttp.test_utils import AioHTTPTestCase


        class InvalidTestCase(AioHTTPTestCase):
            def test_noop(self) -> None:
                pass
        """
    )
    result = testdir.runpytest()
    result.stdout.fnmatch_lines(["*TypeError*"])

This has started failing sometime after 8.1.1.

The log seems to successfully run, rather than erroring.

Output from the test:

FAILED tests/test_test_utils.py::test_testcase_no_app - Failed: nomatch: '*TypeError*'
    and: '============================= test session starts =============================='
    and: 'platform darwin -- Python 3.11.9, pytest-8.4.1, pluggy-1.6.0'
    and: 'codspeed: 3.2.0 (disabled, mode: walltime, timer_resolution: 41.7ns)'
    and: 'rootdir: /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_testcase_no_app0'
    and: 'plugins: xdist-3.7.0, cov-6.2.1, mock-3.14.1, codspeed-3.2.0'
    and: 'collected 0 items'
    and: ''
    and: '============================ no tests ran in 0.01s ============================='
remains unmatched: '*TypeError*'

Dreamsorcerer avatar Jun 20 '25 21:06 Dreamsorcerer