New submission from Yellow Dusk <yellow.dusk1...@fastmail.com>:

testExceptionCleanupNames() is supposed to test that the local variable bound 
to the exception instance is only visible inside the except block, and tests 
that by checking whether the name is in locals(), but it actually deletes the 
name before that, so it appears it isn't testing what it's supposed to be 
testing.

```
        try:
            raise Exception()
        except Exception as e:
            self.assertTrue(e)
            del e
        self.assertNotIn('e', locals())
```

----------
components: Tests
messages: 410997
nosy: yellowdusk1590
priority: normal
severity: normal
status: open
title: testExceptionCleanupNames doesn't test anything?
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46442>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to