Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not restart tests from pdb #1343

Closed
akarl opened this issue Jan 27, 2016 · 4 comments
Closed

Can not restart tests from pdb #1343

akarl opened this issue Jan 27, 2016 · 4 comments
Labels
status: help wanted developers would like help from experts on this topic type: enhancement new feature or API change, should be merged into features branch

Comments

@akarl
Copy link

akarl commented Jan 27, 2016

When running with --pdb py.test can not be restarted with the restart command.

This is the test file:

# test.py
def test_this():
    assert False

This is the output:

$ py.test --version
This is pytest version 2.7.2, imported from [...]/lib/python2.7/site-packages/pytest.pyc
$ py.test test.py --pdb
[...]
test.py:3: AssertionError
>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>
> [...]/test.py(3)test_this()
-> assert False
(PDB) restart
INTERNALERROR> Traceback (most recent call last):
[...]
INTERNALERROR>   File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cmd.py", line 221, in onecmd
INTERNALERROR>     return func(arg)
INTERNALERROR>   File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pdb.py", line 679, in do_run
INTERNALERROR>     raise Restart
INTERNALERROR> Restart
(PDB) continue
== 1 failed in 180.09 seconds ==
$ 
@RonnyPfannschmidt RonnyPfannschmidt added type: enhancement new feature or API change, should be merged into features branch status: help wanted developers would like help from experts on this topic labels Jan 27, 2016
@RonnyPfannschmidt
Copy link
Member

its not clear how to solve that - since restart in pdb is meant for python -m pdb

py.test does not do that kind of post-mortem and restart

@RonnyPfannschmidt
Copy link
Member

is there any more feedback, else i#ll close this one as unsolvable due to lack of detail

@akarl
Copy link
Author

akarl commented Feb 10, 2016

You can close it, unless it's a feature someone else than me would like to have?

Would be really nice to be able to restart the test from within pdb directly.

@szymonjuskowiak
Copy link

szymonjuskowiak commented Jul 31, 2018

Problem occures with selenium and py.test -> you insert breakpoint (e.g. 'assert 0') -> test go in pdb mode -> you inspect code -> want to continue ('continue' command) -> test fail to continue with "== 1 failed in XYS seconds"

../../../.local/share/virtualenvs/XYAPP-u-pKOsnv/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py:242: ElementClickInterceptedException

... entering PDB ...

> /Users/XYUSER/.local/share/virtualenvs/XYAPP-u-pKOsnv/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py(242)check_response() -> raise exception_class(message, screen, stacktrace)

(Pdb) n
[100%]

================================================================================== 1 failed in 221.74 seconds ================================================================================== (XYAPP-u-pKOsnv) (XYAPP-u-pKOsnv) XYUSER-MacBook-Pro:XYAPP XYUSER$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted developers would like help from experts on this topic type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

3 participants