[Python-ideas] Move some regrtest or test.support features into unittest?

Serhiy Storchaka storchaka at gmail.com
Mon Sep 18 07:31:14 EDT 2017


13.09.17 16:42, Victor Stinner пише:
> * skip a test if it allocates too much memory, command line argument
> to specify how many memory a test is allowed to allocate (ex:
> --memlimit=2G for 2 GB of memory)

Instead of just making checks before running some tests it would be 
worth to limit the memory usage hard (by setting ulimit or analogs on 
other plathforms). The purpose of this option is preventing swapping 
which makes tests just hanging for hours.

> * concept of "resource" like "network" (connect to external network
> servers, to the Internet), "cpu" (CPU intensive tests), etc. Tests are
> skipped by default and enabled by the -u command line option (ex: "-u
> cpu).

The problem is what include in "all". The set of resources is 
application specific. Some of resources used in CPython tests make sense 
only for single test.

> * --timeout: watchdog killing the test if the run time exceed the
> timeout in seconds (use faulthandler.dump_traceback_later)

This feature looks functionally similar to limiting memory usage.

> * --match, --matchfile, -x: filter tests

The discovery feature of unittest looks similar.

> * ... : regrtest has many many features

Many of them contain a bunch of engineering tricks and evolve quickly. 
Regrtest now is not a regrtest two years ago, and I'm sure that two 
years later it will differ too much from the current. Unittest should be 
more stable.



More information about the Python-ideas mailing list