This is relevant for when using "q" with pdb from there (post_mortem). https://github.com/blueyed/pytest/pull/132 Possibly related: https://github.com/pytest-dev/pytest/issues/3144