mozilla / frost

Unit testing framework for test driven security of AWS, GCP, Heroku and more.
https://mozilla.github.io/frost/
Mozilla Public License 2.0
104 stars 24 forks source link

sphinx-apidoc cannot cleanly import many modules #409

Open hwine opened 3 years ago

hwine commented 3 years ago

This started with #389 -- while it doesn't "break" the documentation, it is very noisy, and may mean our docs are not as useful as they could be. In some ways, this is "phase 2" of adding docs, so is enhancement, not bug.

Example failure:

WARNING: autodoc: failed to import module 'test_ec2_security_group_opens_all_ports' from module 'aws.ec2'; the following exception was raised:
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 66, in import_module
    return importlib.import_module(modname)
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/travis/build/mozilla/frost/aws/ec2/test_ec2_security_group_opens_all_ports.py", line 13, in <module>
    ec2_security_groups_with_in_use_flag(),
  File "/home/travis/build/mozilla/frost/aws/ec2/resources.py", line 128, in ec2_security_groups_with_in_use_flag
    sec_groups = ec2_security_groups()
  File "/home/travis/build/mozilla/frost/aws/ec2/resources.py", line 38, in ec2_security_groups
    botocore_client.get("ec2", "describe_security_groups", [], {})
AttributeError: 'NoneType' object has no attribute 'get'