Comments (7)
Found this thread while looking for a similar but slightly different usecase. I believe that this issue is a prerequisite for the feature I'm looking for - but please let me know if I am mistaken.
It would be incredibly helpful for pytest-pudb
to support pdb run
style restarts with pytest --pudb
created breakpoints. Specifically, when writing tests for an application it is rarely the test code that is in error, rather a supporting function that has already been invoked before the failing assertion. I don't believe that it is possible to backstep, but pudb
does support easy jumps through the stacktrace via m
that allow breakpoint creation at the suspected point of failure.
from pytest-pudb.
This would be very useful for me.
from pytest-pudb.
Is there any new development regarding the loading of external pudb breakpoints? I would be interested to get involved.
from pytest-pudb.
How is this done?
from pytest-pudb.
Sorry, not yet. But I'll be happy to merge a PR for this feature.
from pytest-pudb.
Any hints on how can I do that? (not the PR, but how should this be approached like where these files usually are when using pudb, whats their format.. you know couple of links to start digging)
from pytest-pudb.
For sure. There are 2 main classes you need to work with: PuDB Debugger and it's base Bdb from python's library.
- Bdb has a method
set_break()
that sets breakpoint on the particular line. - PuDB has some code to parse external breakpoints file (
load_breakpoints()
function that is called at PuDB debugger initialisation). - Note, that running all code under the tracing hook will kill the execution performance. So there is a method
Bdb.set_continue()
that sets tracing hook only if there are breakpoints set. PuDB.set_trace()
takes an optional parameterpause
, that indicates whether debugger must stop at the current line or continue work, without stopping.- Pytest has plugin hooks that we can stick to to start our code under debugger.
I think that the best solution would be to add some cmd parameter, that will mean two things:
- We need to parse breakpoints from the external file (I'd prefer pointing this file via that parameter than forcing user to put that file in the
XDG_CONFIG_DIRS
path that PuDB does). - We need to start debugger tracing hook at the beginning of our tests run via pytest hook.
from pytest-pudb.
Related Issues (12)
- Implement the pudb.b module
- Allow opening pudb not just on errors HOT 2
- pytest-pudb breaks datetime HOT 12
- Latest Pytest release (3.3.1) breaks pytest-pudb HOT 1
- Support pu.db
- TypeError in PuDBInvoke when using pytest --capture=no HOT 1
- Look at __tracebackhide__
- tagging releases
- Add unittests
- PyPI package for v0.4 is broken HOT 1
- Avoid tearDown and cleanup in post mortem debugging
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-pudb.