[PATCH] D39763: [clang] [python] [tests] Rewrite to use standard unittest module

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 7 14:59:36 PST 2017


mgorny created this revision.

Rewrite the tests from using plain 'assert' mixed with some nosetests
methods to the standard unittest module layout. Improve the code
to use the most canonical assertion methods whenever possible.

This has a few major advantages:

- the code uses standard methods now, resulting in a reduced number

of WTFs whenever someone with basic Python knowledge gets to read it,

- completely unnecessary dependency on nosetests is removed since

the standard library supplies all that is necessary for the tests
to run,

- the tests can be run via any test runner, including the one built-in

in Python,

- the failure output for most of the tests is improved from 'assertion

x == y failed' to actually telling the values.


Repository:
  rL LLVM

https://reviews.llvm.org/D39763

Files:
  bindings/python/README.txt
  bindings/python/tests/cindex/test_access_specifiers.py
  bindings/python/tests/cindex/test_cdb.py
  bindings/python/tests/cindex/test_code_completion.py
  bindings/python/tests/cindex/test_comment.py
  bindings/python/tests/cindex/test_cursor.py
  bindings/python/tests/cindex/test_cursor_kind.py
  bindings/python/tests/cindex/test_diagnostics.py
  bindings/python/tests/cindex/test_exception_specification_kind.py
  bindings/python/tests/cindex/test_file.py
  bindings/python/tests/cindex/test_index.py
  bindings/python/tests/cindex/test_linkage.py
  bindings/python/tests/cindex/test_location.py
  bindings/python/tests/cindex/test_tls_kind.py
  bindings/python/tests/cindex/test_token_kind.py
  bindings/python/tests/cindex/test_tokens.py
  bindings/python/tests/cindex/test_translation_unit.py
  bindings/python/tests/cindex/test_type.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39763.121990.patch
Type: text/x-patch
Size: 134990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171107/d8e8c62f/attachment-0001.bin>


More information about the cfe-commits mailing list