##### SUMMARY

In the Kubernetes collection's CI tests, the sanity check, which uses `ansible-test sanity --docker -v --color --python 3.6`, started failing with the following error:

```
ERROR: Command "importer.py" returned exit status 1.
>>> Standard Error
Traceback (most recent call last):
  File "/root/ansible/ansible_collections/community/kubernetes/tests/output/.tmp/sanity/import/minimal-py36/bin/importer.py", line 447, in <module>
    main()
  File "/root/ansible/ansible_collections/community/kubernetes/tests/output/.tmp/sanity/import/minimal-py36/bin/importer.py", line 51, in main
    from ansible.utils.collection_loader import AnsibleCollectionLoader
  File "/root/ansible/lib/ansible/utils/collection_loader.py", line 15, in <module>
    from ansible import constants as C
  File "/root/ansible/lib/ansible/constants.py", line 12, in <module>
    from jinja2 import Template
ModuleNotFoundError: No module named 'jinja2'
```

Nothing in the collection has changed in the past week, and no runs failed until this morning's CI run, so it seems something committed to ansible/ansible `devel` has caused this failure.

##### ISSUE TYPE

- Bug Report

##### COMPONENT NAME

ansible-test

##### ANSIBLE VERSION

devel (as of this morning)

##### CONFIGURATION

N/A - defaults

##### OS / ENVIRONMENT

Linux

##### STEPS TO REPRODUCE

  1. Clone kubernetes collection repo
  2. Install Ansible @ devel
  3. Run `ansible-test sanity --docker -v --color --python 3.6`

##### EXPECTED RESULTS

Tests should pass, as they have for the past few weeks.

##### ACTUAL RESULTS

Test fail, with the message in this issue's summary.
"""
    Return the containing collection name for a given path, or None if the path is not below a configured collection, or
    the collection cannot be loaded (eg, the collection is masked by another of the same name higher in the configured
    collection roots).
    :param n_path: native-string path to evaluate for collection containment
    :return: collection name or None
    """
    n_collection_paths = [to_native(os.path.realpath(to_bytes(p))) for p in AnsibleCollectionLoader().n_collection_paths]
    b_path = os.path.realpath(to_bytes(path))
    n_path = to_native(b_path)
    for coll_path in n_collection_paths:
        common_prefix = to_native(os.path.commonprefix([b_path, to_bytes(coll_path)]))
        if common_prefix == coll_path:
            
            collection_remnant = n_path[len(coll_path):]
            
            if collection_remnant and collection_remnant[0] != '/':
                collection_remnant = '/' + collection_remnant
            
            found_collection = _N_COLLECTION_PATH_RE.search(collection_remnant)
            if not found_collection:
                continue
            n_collection_name = '{0}.{1}'.format(*found_collection.groups())
            loaded_collection_path = AnsibleCollectionLoader().get_collection_path(n_collection_name)
            if not loaded_collection_path:
                return None