[issue44297] Frame with -1 line number

Shreyan Avigyan report at bugs.python.org
Tue Jun 22 16:09:50 EDT 2021


Shreyan Avigyan <shreyan.avigyan at gmail.com> added the comment:

Here presumably the error is occurring somewhere near unittest. I've tested this and wrote a minimal reproducible example. 

```
import unittest

class TestingError(unittest.TestCase):
    def test_negative_one(self):
        with self.assertRaisesRegex(AssertionError, "xxxxx"):
            self.assertEqual(1, 2)
```

Running this with `unittest discover` or in any other command-line way (like -c) results in frame with -1 while running it from script (with unittest.main probably) does not.

Hope this helps.

----------
nosy: +shreyanavigyan

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44297>
_______________________________________


More information about the Python-bugs-list mailing list