[New-bugs-announce] [issue18258] Fix test discovery for test_codecmaps*.py

Zachary Ware report at bugs.python.org
Tue Jun 18 23:16:03 CEST 2013


New submission from Zachary Ware:

The test package is almost to the point where I can run `PCbuild\python_d.exe -m unittest discover Lib/test/ "test_*.py"` and get a useful result, the only thing that still blows up is multibytecodec_support.py.  I had not previously noticed this problem due to the way support.open_urlresource works, requiring the 'urlfetch' resource if and only if the requested file has not already been fetched before and stored in the Lib/test/data dir.  multibytecodec_support.TestBase_Mapping blows things up because it uses __init__ instead of setUp to try opening the needed file, which causes ResourceDenied to be raised at class creation time rather than test run time, which unittest can't handle.  The attached patch fixes this (at the expense of opening and closing the file once per test method, rather than once per class) as well as converting the test_codecmaps* scripts from test_main to unittest.main.

----------
components: Tests
files: test_codecmaps_discovery.diff
keywords: patch
messages: 191434
nosy: brett.cannon, ezio.melotti, zach.ware
priority: normal
severity: normal
status: open
title: Fix test discovery for test_codecmaps*.py
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30644/test_codecmaps_discovery.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18258>
_______________________________________


More information about the New-bugs-announce mailing list