[docs] [issue32843] More revisions to test.support docs

Nick Coghlan report at bugs.python.org
Tue Feb 20 20:22:35 EST 2018

Nick Coghlan <ncoghlan at gmail.com> added the comment:

For TESTFN_NONASCII vs TESTFN_UNICODE (inferred from reading the current code & https://github.com/python/cpython/commit/8b219b2936d767bf6c6c17618db3a7b22fc2e865):

* TESTFN_NONASCII guarantees that it can be encoded and decoded with the default filesystem encoding, but may be None if it can't find a suitable non-ASCII character that meets that constraint. This allows affected tests to be easily skipped on platforms where they can't work.
* TESTFN_UNICODE is always set, but may *not* be encodable with os.fsencode()

(The two could potentially be consolidated by converting the tests that use TESTFN_UNICODE over to TESTFN_NONASCII, but for now it makes sense to just document the above differences)

For the logging helpers, I'd check how they're used in test_logging: if they're used in logging configuration tests, they may be in test.support to avoid reimporting the module that defines the logging tests. If so, then they can be filed away in their own subsection at the end of the test.support documentation. If not, then yeah, moving them into test_logging would make sense.

Similarly, moving the distutils helper makes sense to me, *unless* there's a specific reason that importing it from "distutils.tests.support" instead would be problematic.


Python tracker <report at bugs.python.org>

More information about the docs mailing list