$ cat foo.py from tenacity import retry @retry def foo(n): foo(n+1) def test_foo(): foo(0) $ pytest foo.py ============================================================================================================================= test session starts ============================================================================================================================= platform linux -- Python 3.7.3, pytest-5.4.1, py-1.7.0, pluggy-0.13.1 rootdir: /home/dev/swh-environment/swh-storage, inifile: pytest.ini plugins: parallel-0.0.10, django-3.7.0, hypothesis-5.5.1, forked-1.1.3, kafka-0.4.0, celery-4.4.0, mock-1.13.0, xdist-1.31.0, testinfra-4.0.0, swh.core-0.0.94.post4, requests-mock-1.5.2, postgresql-2.2.0 collected 1 item foo.py [1] 17965 abort pytest foo.py