[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, @yellowdusk1590!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
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 miss-islington


miss-islington  added the comment:


New changeset e064af564c8580285a76199229864ddfb1e50c0f by Miss Islington (bot) 
in branch '3.9':
bpo-46442: improve and rename testExceptionCleanupNames (GH-30758)
https://github.com/python/cpython/commit/e064af564c8580285a76199229864ddfb1e50c0f


--

___
Python tracker 

___
___
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 miss-islington


miss-islington  added the comment:


New changeset d4a9e34401d519250d3b3744cd10394069f748c1 by Miss Islington (bot) 
in branch '3.10':
bpo-46442: improve and rename testExceptionCleanupNames (GH-30758)
https://github.com/python/cpython/commit/d4a9e34401d519250d3b3744cd10394069f748c1


--

___
Python tracker 

___
___
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 miss-islington


Change by miss-islington :


--
pull_requests: +28964
pull_request: https://github.com/python/cpython/pull/30779

___
Python tracker 

___
___
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 miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28963
pull_request: https://github.com/python/cpython/pull/30778

___
Python tracker 

___
___
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 Eric V. Smith


Eric V. Smith  added the comment:


New changeset 82c53229e18f5853c82cb8ab6b9af1925a0e9e58 by Yellow Dusk in branch 
'main':
bpo-46442: improve and rename testExceptionCleanupNames (GH-30758)
https://github.com/python/cpython/commit/82c53229e18f5853c82cb8ab6b9af1925a0e9e58


--

___
Python tracker 

___
___
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 

___
___
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 

___
___
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 

___
___
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-20 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Perhaps it's testing that the implicit `del` doesn't blow up if the variable is 
already deleted.

--
nosy: +Jelle Zijlstra

___
Python tracker 

___
___
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-20 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
nosy: +sobolevn

___
Python tracker 

___
___
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-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't know for sure, but maybe it's trying to test "del" interacting with the 
fact that the "as e" part doesn't escape the "except" clause, unlike normal 
assignments:

>>> try:
... raise Exception
... except Exception as e:
... print('exception raised')
... foo = 1
...
exception raised
>>> foo
1
>>> e
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'e' is not defined

--
nosy: +eric.smith

___
Python tracker 

___
___
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-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 

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