GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — bpo-29598 Add couple of unit tests for pdb module by archy-rock3t-cloud · Pull Request #218 · python/cpython Conversation
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
archy-rock3t-cloud
force-pushed
the
bpo-29598-add-unit-tests-for-pdb
branch
from
2a5a46d to
3479961
Compare
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
methane
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
methane
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like this hack to get frame object for module...
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
methane
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm afraid this test is relying implementation detail.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What implementation detail ? As a side note, offsets increase monotonically so min_offset is the first offset yielded by findlinestarts() and max_offset is the last one (no need to invoke min() or max()).
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't research deeply, I just worried. So if PyPy passes this, it's OK. I think attributes of Python's code object is implementation detail, even though PyPy follows.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have started a discussion on python-dev about attributes of Python code objects being implementation detail.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @methane
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @xdegaye I didn't say "I want to do ...". I was asked to review, and leave comment what I feel.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please ignore me when my comment doesn't make sense for you.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
OK. I leave some comments. But I think I'm not suited to this change, because this code uses some inspect magic and |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@methane thank you very much for comments, can you please suggest person who can review test for pdb? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I usually use Experts Index and git history to find experts. Experts Index doesn't tell expert of pdb. But @1st1 is listed as expert of inspect module. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
And there are some comments in b.p.o |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
3479961 to
fcf80b0
Compare
|
While pdb and inspect relying on implementation, PyPy is compatible at this point. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| self.assertEqual(actual_lineno, expected_lineno) | ||
|
|
||
| def test_getsourcelines_with_module_frame_obj(self): | ||
| for frame, *unused in inspect.getouterframes(inspect.currentframe()): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't like test relying on outer frame.
I like test which doesn't relying test runner implementation.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
But documentation says that whitebox tests are preferred
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"whitebox test" is relying on implementation of test target, not test runner.
What is module_frame here? Isn't it relying on test runner?
It can be changed even if pdb and test_pdb is not changed.
So I prefer creating module frame in this test, not capturing from caller of this test.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
BTW, is there any difference between module frame and other frames from pdb's point of view?
If there is no difference, function frame is far easier to create, maybe.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
In this case I need specifically module frame(as you can see from pdb code itself) and it seems like it doesn't matter which module frame it will be. Can you please show how to create it manually?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
frame = inspect.currentframe()
frame must be current test's frame. caller's frame shouldn't affects this test.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It won't be module frame.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ah, I'm sorry. I misread "I need" as "I don't need".
Now I read pdb.getsourcelines().
If I'm correct, do you want to test this one line: return lines, 1?
I don't know way to create module frame which is simple enough to test such simple one line.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would like it to be tested. Initially, when I've seen test coverage of stdlib I wanted to write some tests to improve it. Now it seems like tough task, because it is not even clear who should approve my PRs. If I address all comments here and in bpo, whom can I ask to approve my PR?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…dded SLP - Fix test_outside to reset cstack_base and cstack_root. Now the simulation of a call from outside is complete. - Add test_slp_embed to test embedding Stackless
…terpreter The fix for Stackless issue 186 (support for sub-interpreters) broke some typical use cases.
…dded SLP - Fix test_outside to reset cstack_base and cstack_root. Now the simulation of a call from outside is complete. - Add test_slp_embed to test embedding Stackless. Currently it gets skipped, because it requires a not yet available class.
…terpreter The fix for Stackless issue 186 (support for sub-interpreters) broke some typical use cases. (cherry picked from commit 5b29b24)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.