[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-19 Thread Yellow Dusk


New submission from Yellow Dusk :

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 
<https://bugs.python.org/issue46442>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-21 Thread Yellow Dusk


Yellow Dusk  added the comment:

Great point, it's indeed a good thing to test. So I guess the test is just 
incomplete.

--

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



[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-21 Thread Yellow Dusk


Change by Yellow Dusk :


--
keywords: +patch
pull_requests: +28940
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30753

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



[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-21 Thread Yellow Dusk


Change by Yellow Dusk :


--
pull_requests: +28945
pull_request: https://github.com/python/cpython/pull/30758

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