This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients xtreak
Date 2018-12-04.10:17:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543918633.67.0.788709270274.issue35405@psf.upfronthosting.co.za>
In-reply-to
Content
While running under pdb when I have an assertion error after the command continue then  the assertion error is mentioned with the statement under which I have executed continue command in pdb. Below script has an assertion error on assert 1 == 2 but when I execute continue from assert 1 == 1 then it shows the line assert 1 == 1 with the AssertionError. I first noticed this with unittest but seems to be a general issue with assert. This is confusing while debugging unittest failures. 

I searched for issues but couldn't find a related one and this exists on master and 2.7. I assume this is a case where AssertionError doesn't use the current line and uses the one where pdb is executed with continue? I don't know if this is an issue with pdb or assert so I am adding Library as the component.

# Reproducible script

import pdb; pdb.set_trace();

assert 1 == 1

for i in range(10):
    pass

assert 1 == 2

# Executing on master

➜  cpython git:(master) $ ./python.exe /tmp/foo.py
> /tmp/foo.py(3)<module>()
-> assert 1 == 1
(Pdb) c
Traceback (most recent call last):
  File "/tmp/foo.py", line 3, in <module>
    assert 1 == 1
AssertionError
History
Date User Action Args
2018-12-04 10:17:13xtreaksetrecipients: + xtreak
2018-12-04 10:17:13xtreaksetmessageid: <1543918633.67.0.788709270274.issue35405@psf.upfronthosting.co.za>
2018-12-04 10:17:13xtreaklinkissue35405 messages
2018-12-04 10:17:13xtreakcreate