pdb: add option to skip pdb.set_trace()#4854
Conversation
|
It is meant ease running tests, where the code is (full of) |
Codecov Report
@@ Coverage Diff @@
## features #4854 +/- ##
============================================
+ Coverage 96.05% 96.06% +<.01%
============================================
Files 114 114
Lines 25737 25747 +10
Branches 2547 2549 +2
============================================
+ Hits 24722 24734 +12
+ Misses 704 703 -1
+ Partials 311 310 -1
Continue to review full report at Codecov.
|
pdb.set_trace()pdb.set_trace()
jeffreyrack
left a comment
There was a problem hiding this comment.
Would it make sense to wrap pdb.set_trace() when the option isn't used to help users know about the option?
Something like:
example_test.py
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB set_trace (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
To disable break points set via pdb, use --pdb-skip.
> /home/vagrant/pytest-source/example_test.py(7)test_a()
-> a = 'b'
(Pdb)
|
What about the option name(s)? I've used/added a longer run for clarify, but the typical use would rather be to append |
Personally I prefer |
Not a bad idea - but in general it just adds noise - typically you would a I consider this new feature rather as a gem for advanced users, which are also messy by needing it in the first place.. ;) Similar to how e.g. pdbpp also has an |
|
@nicoddemus |
The code looks good, but I'm not sure I understand the user case, can you please elaborate? |
It allows to use inprocess pytest instead of pexpect. One downside currently is that you do not get the "stdin gets echoed to stdout" that terminals normally do. |
pdb.set_trace()pdb.set_trace()
|
Waiting for coverage improvements through master to rebase this against. |
|
Would it be better to not implement this and wait for |
Oh, wasn't aware of it. Should we just respect / look at it here instead? |
👍 sg2m |
|
Well, almost finished it - but then thought that having to set |
|
My leaning is that pytest shouldn't reimplement stuff that's standard python (then you have to learn two sets of tools), curious to hear what the others have to say though |
|
Well, |
|
That's a good point, which makes this feature seem even less of a good idea since it won't handle other debuggers like |
|
Yes, it is specific to |
|
My hope for the debugging plugins was that as we eventually drop <3.7 we can just use |
pdb.set_trace()pdb.set_trace()
|
Just found that Otherwise I think this is good for now, but could only need some addition to the docs maybe? |
|
:S |
|
? |
|
My impression was we weren't going to merge this as is given these comments: |
|
@asottile |
|
As for looking at PYTHONBREAKPOINT: I think that this is not really that much relevant here, since this is about skipping |
heh well I didn't think I had to block it because it was |
Not here.. WIP is just a silly blocking status. |
have greatly appreciated this btw 👍 I used to |
Interesting - did not know that exists.. |
|
Reverting it in #5173. |
Revert "Merge pull request #4854 from blueyed/pdb-skip"
TODO: