[New-bugs-announce] [issue18273] Simplify calling and discovery of json test package

Zachary Ware report at bugs.python.org
Thu Jun 20 22:30:20 CEST 2013


New submission from Zachary Ware:

Technically, test discovery already works for test_json.py / json_tests, but not the way really expected (each test file is discovered individually), and not as simply as it could.  The attached patch does the following:

- remove test_json.py
- rename json_tests to test_json (to match all other tests, following the example of test_email and test_importlib)
- remove main() and 'if __name__ == "__main__"' stanza from __init__.py
- rename test_suite() to load_tests(*args)
- Add test_json/__main__.py, which calls unittest.main

I believe this is the simplest, cleanest way to convert the json tests from test_main to unittest.main().

The patch is against 3.3; there are changes in 3.4 that make a patch against it not apply to 3.3.  It merges forward easily, though.

----------
components: Tests
files: test_json_discovery-3.3.diff
keywords: patch
messages: 191537
nosy: brett.cannon, ezio.melotti, zach.ware
priority: normal
severity: normal
status: open
title: Simplify calling and discovery of json test package
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30658/test_json_discovery-3.3.diff

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


More information about the New-bugs-announce mailing list