Due to a missing unittest.main() call, the header_generator_test was not actually running any tests when run with bazel/run directly. However, the failure was noticed by python -m unittest discover. Fixed the header_generator_test in the following ways:
Import test_util (tests failed due to missing import).
Change attribute_checker.normalize_and_verify to header_generator.generate_header.
Remove unused imports.
Make appropriate BUILD changes.
Add unittest.main() call so that unit tests are run.
Additionally, this change adds a (blank) __init__.py to compiler/ and compiler/util/ so that they are importable by the unittest module. This means that running python -m unittest discover -p '*_test.py' from the main emboss repository should run all python tests in the compiler - and could be a good sanity check to make sure all python tests pass, even when bazel test compiler/... could miss tests (not declared in BUILD or missing the unittest.main() call).
Due to a missing
unittest.main()
call, the header_generator_test was not actually running any tests when run with bazel/run directly. However, the failure was noticed bypython -m unittest discover
. Fixed the header_generator_test in the following ways:Additionally, this change adds a (blank) __init__.py to compiler/ and compiler/util/ so that they are importable by the unittest module. This means that running
python -m unittest discover -p '*_test.py'
from the main emboss repository should run all python tests in the compiler - and could be a good sanity check to make sure all python tests pass, even whenbazel test compiler/...
could miss tests (not declared in BUILD or missing the unittest.main() call).