[issue19696] Merge all (non-syntactic) import-related tests into test_importlib

aeros167 report at bugs.python.org
Fri Jun 21 01:34:59 EDT 2019


aeros167 <aeros167 at gmail.com> added the comment:

Decided to start working on this issue, seems like a solid starting point. After submitting a minor doc contribution, I wanted to also attempt to contribute to some of the easier enhancement requests. 

>From my current assessment, it appears that "test_pkgimport", "test_threaded_import", and "threaded_import_hangers" all would appropriately be categorized in test_importlib. Pkgimport attempts to build the package, perform basic filesystem tests, and ensure that run time errors are correctly functioning. "threaded_import" attempts to simultaneously important multiple modules by assigning each one to different threads. The purpose of "threaded_import_hangers" is specifically dependent on "threaded_import", so those two should be grouped together.

While going through test_pkgimport I noticed that it uses the method "random.choose" on lines 17 and 63. However, the standard seems to "random.choice". I could not find any specific mention of random.choose on the python docs, so this appears to be a deprecated method. As far as I'm aware "random.choice" follows current standard and is used far more frequently within the CPython repository. Would it be appropriate to change the "choose" method to "choice"? 

Additionally, as far as naming convention goes, should the name of "test_pkgimport" instead be "test_pkg_import"? This is entirely semantics, but it makes for better consistency with the other file names and is a bit more readable. Also, would it be best to perform all of these changes within separate pull requests, or are they minor enough to be combined into one?

----------
nosy: +aeros167

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19696>
_______________________________________


More information about the Python-bugs-list mailing list