[PATCH] D37378: [clang] [python] Move test_exception_specification_kind to correct subdir

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 1 06:47:31 PDT 2017


mgorny created this revision.

The test_exception_specification_kind.py test has been committed
to the tests/ directory of clang Python bindings. As a result, it fails
since it attempts to load util.py module relatively from the current
directory:

  ======================================================================
  ERROR: Failure: ImportError (No module named 'tests.util')
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/lib64/python3.5/site-packages/nose/failure.py", line 39, in runTest
      raise self.exc_val.with_traceback(self.tb)
    File "/usr/lib64/python3.5/site-packages/nose/loader.py", line 419, in loadTestsFromName
      addr.filename, addr.module)
    File "/usr/lib64/python3.5/site-packages/nose/importer.py", line 47, in importFromPath
      return self.importFromDir(dir_path, fqname)
    File "/usr/lib64/python3.5/site-packages/nose/importer.py", line 94, in importFromDir
      mod = load_module(part_fqname, fh, filename, desc)
    File "/usr/lib64/python3.5/imp.py", line 234, in load_module
      return load_source(name, filename, file)
    File "/usr/lib64/python3.5/imp.py", line 172, in load_source
      module = _load(spec)
    File "<frozen importlib._bootstrap>", line 693, in _load
    File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 673, in exec_module
    File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
    File "/usr/src/llvm/tools/clang/bindings/python/tests/test_exception_specification_kind.py", line 3, in <module>
      from .util import get_tu
  ImportError: No module named 'tests.util'

After looking through the tree and the history of https://reviews.llvm.org/D34091, it seems that
the test was intended for the tests/cindex subdirectory where util.py
is indeed present. Move it there to fix the test.


Repository:
  rL LLVM

https://reviews.llvm.org/D37378

Files:
  bindings/python/tests/cindex/test_exception_specification_kind.py
  bindings/python/tests/test_exception_specification_kind.py






More information about the cfe-commits mailing list