New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

Currently tests for curses mainly call different functions and methods in 
random order. Not all argument combinations are covered by tests and results 
are not checked. I also ran tests with 1750 different values of TERM supported 
by ncurses, and some tests were failed because not all features are supported 
on all terminals.

The proposed PR rewrites tests for curses.

* Added tests for every function or group of related functions.

* Added separate tests for optional functions, so that skipped tests are shown 
it output.

* Optionally skipped tests for functions like beep() and flush() which do not 
supported an all terminals (surprisingly!).

* Every function which takes variable number of arguments is now tested with 
all combination of arguments.

* Functions which support different types of argument (str/bytes/int) are now 
tested with all supported types.

* Function which change the global state are now called in order which restores 
presumably default value.

* Checked values and types of results of functions.

* Some tests serve role of demos. They call some function in some order and 
check how it affects results of other functions.

* Tests now work on terminals with small size (15 lines or less). Some 
terminals have very small default size.

It could still be improved (for example not all functions are tested with 
non-ASCII strings), but I spent several weekends (including a New Year and both 
Christmases) on this work and want to take a break.

----------
components: Tests
messages: 385583
nosy: serhiy.storchaka, twouters
priority: normal
severity: normal
status: open
title: Improve tests for curses
type: enhancement
versions: Python 3.10, Python 3.8, Python 3.9

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

Reply via email to