[issue43988] Add test.support.assert_dissallow_instantiation

2021-05-27 Thread STINNER Victor


STINNER Victor  added the comment:

> I believe we can close this now, Victor. Please reopen if you disagree :)

I validated that all tests named "test(...)disallow(...)inst(...)" are now 
using support.check_disallow_instantiation().

Lib/test/test_tcl.py might use it in:

@support.cpython_only
def test_new_tcl_obj(self):
self.assertRaises(TypeError, _tkinter.Tcl_Obj)
self.assertRaises(TypeError, _tkinter.TkttType)
self.assertRaises(TypeError, _tkinter.TkappType)

Serhiy suggested to write an unit test for curses.ncurses_version:
https://bugs.python.org/issue43916#msg391936

This work can be done in bpo-43916.

--

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-05-27 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I believe we can close this now, Victor. Please reopen if you disagree :)

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-05-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8cec740820fc875117bfa7b6bdb10202ebeb8fd5 by Erlend Egeberg 
Aasland in branch 'main':
bpo-43988: Document test.support.check_disallow_instantiation() (GH-26394)
https://github.com/python/cpython/commit/8cec740820fc875117bfa7b6bdb10202ebeb8fd5


--

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-05-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fbff5387c3e1f3904420fa5a27738c6c5881305b by Erlend Egeberg 
Aasland in branch 'main':
bpo-43988: Use check disallow instantiation helper (GH-26392)
https://github.com/python/cpython/commit/fbff5387c3e1f3904420fa5a27738c6c5881305b


--

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-05-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24987
pull_request: https://github.com/python/cpython/pull/26394

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-05-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24985
pull_request: https://github.com/python/cpython/pull/26392

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-05-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4f725261c6cf23d259e8fdc205e12b76ef4d2d31 by Erlend Egeberg 
Aasland in branch 'main':
bpo-43988: Add test.support.check_disallow_instantiation() (GH-25757)
https://github.com/python/cpython/commit/4f725261c6cf23d259e8fdc205e12b76ef4d2d31


--

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-04-30 Thread STINNER Victor


STINNER Victor  added the comment:

You can keep PR 25757 to add the helper function, and then write a second PR to 
use it in all tests.

--

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-04-30 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

I'll fix your typo ;) I'll include the rest of the test in the PR. I just 
pushed it out quickly to get a review of the solution.

--

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-04-30 Thread STINNER Victor


STINNER Victor  added the comment:

You can take this issue as an opportunity to fix my typo :-)

Lib/test/test_hashlib.py: "test_disallow_instanciation" => 
"test_disallow_instantiation".
https://github.com/python/cpython/commit/665c7746fca180266b121183c2d5136c547006e0#commitcomment-50235589

There are now many tests:

Lib/test/test_array.py:def test_disallow_instantiation(self):
Lib/test/test_curses.py:def test_disallow_instantiation(self):
Lib/test/test_dbm_gnu.py:def test_disallow_instantiation(self):
Lib/test/test_embed.py:def test_disallow_instantiation(self):
Lib/test/test_functools.py:def test_disallow_instantiation(self):
Lib/test/test_hashlib.py:def test_disallow_instanciation(self):
Lib/test/test_hashlib.py:def test_hash_disallow_instanciation(self):
Lib/test/test_re.py:def test_disallow_instantiation(self):
Lib/test/test_select.py:def test_disallow_instantiation(self):
Lib/test/test_threading.py:def test_disallow_instantiation(self):
Lib/test/test_unicodedata.py:def test_disallow_instantiation(self):
Lib/test/test_zlib.py:def test_disallow_instantiation(self):

--

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-04-30 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-04-30 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
type:  -> enhancement

___
Python tracker 

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



[issue43988] Add test.support.assert_dissallow_instantiation

2021-04-30 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

See https://github.com/python/cpython/pull/25748#discussion_r623849521:
"What do you think of adding support.assert_disallow_instanciation(type, *args) 
function which would check for TypeError but also check the error message? 
TypeError is quite generic and it might hide a bug."


Ref. bpo-43916.

--
components: Tests
messages: 392436
nosy: erlendaasland, vstinner
priority: normal
severity: normal
status: open
title: Add test.support.assert_dissallow_instantiation

___
Python tracker 

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