STINNER Victor added the comment:

I pushed the changeset eaf9a99b6bb8, but R. David Murray asked me to wait for a 
review before pushing changes. So I reverted my change.

I checked if Lib/test/regrtest.py is called directly. The answer is yes: it's 
called inside Python in various places, but also in scripts to build Python 
packages. Even if "python -m test" works (and "python -m test.regrtest" works 
on all Python versions), I prefer to keep Lib/test/regrest.py to not force 
users to have to modify their script.

So I propose to simply move regrtest.py code to smaller files in 
Lib/test/libregrtest/, as I did in attached regrtest_package.patch.

In the changeset eaf9a99b6bb8, I started with cmdline.py because it's the only 
part of regrtest.py which has real unit tests. I created 
Lib/test/libregrtest/cmdline.py with "hg cp" to keep Mercurial history. I 
checked which moved symbols are used: _parse_args() and RESOURCE_NAMES. I 
exported them in test.libregrtest. I had to modify Lib/test/test_regrtest.py.

For next changes, I will try to add a few new unit tests to 
Lib/test/test_regrtest.py.

--

Berker wrote: "I like the new features, but I think we should take a look at 
issue 10967 before converting it to a package or refactoring it."

IMHO it will be easier to enhance regrtest to reuse unit test features, make 
the code smaller, fix bugs, etc. if regrtest.py is splitted into smaller files. 
Moving code to a new test.libregrtest submodule should help to implement the 
issue #10967 & friends (ex: #16748)

----------

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

Reply via email to