Hi, > 1. Am I missing something or does pytest indeed completely seal off its internals?
Not really, you can access _pytest module directly: >>> import _pytest.pdb >>> _pytest.pdb.pytestPDB <class _pytest.pdb.pytestPDB at 0x026F0500> > 2. Am I approaching this wrong? How else could I go about achieving my goal of disabling the timeout? Personally I would try to implement this in pytest-timeout instead, possibly by adding a `disable_all_timeouts()` API function would be called automatically when `pdb.set_trace()` is called. This also leaves room for other code to disable timeout handling if needed. Cheers, On Sat, Sep 13, 2014 at 10:50 AM, Wolfgang Schnerring <[email protected]> wrote: > Hi, > > I'd really love for pytest_timeout to not perform the timeout when I'm > using > pdb (more specifically, the "import pdb; pdb.set_trace()" statement; I'm > aware that pytest_timeout learned to respect the "--pdb" command line > parameter recently), because it invariably bites me and then I have to > re-run the tests with "--timeout=0", which is annoying. > > So, this means I'd need to do /something/ (most probably set a flag) as > part > of the pdb.set_trace() call. I gathered that pytest already wraps the > pdb.set_trace() call for its own purposes, so I guess I'd need to wrap > *that*. > > The easiest way to achieve that wrapping would be to subclass the > "pytestPDB" class (simply wrapping it with a function messes up the > frames). > However, pytest has this magic going on where its parts are in the > "_pytest" > submodule which is not a normal module but something else entirely. Which > means, as far as I can tell, I cannot "import pytest._pytest.pdb", which is > to say, I cannot access the pytestPDB class at all. > > Which leaves me with two questions: > 1. Am I missing something or does pytest indeed completely seal off its > internals? Does that mean pytestPDB would need to grow a plugin hook (say, > "pytest_pdb_interact", as a companion to "pytest_exception_interact")? > 2. Am I approaching this wrong? How else could I go about achieving my goal > of disabling the timeout? > > Thanks for your help, > Wolfgang > > _______________________________________________ > Pytest-dev mailing list > [email protected] > https://mail.python.org/mailman/listinfo/pytest-dev >
_______________________________________________ Pytest-dev mailing list [email protected] https://mail.python.org/mailman/listinfo/pytest-dev
