Unfortunately, apt_pkg is known to cause issues with virtualenvs, because it is non-trivial to recompile. Additionally, the automated test runner looks for a ".venv" target in the Makefile and if it doesn't find one, it creates a venv for you. In this case, you will need to create a venv yourself, using --system-site-packages so that apt_pkg can be accessed.
Another option, though it is less recommended, is to create a tests.yaml file that instructs bundletester to not create a virtualenv at all. The tests.yaml file format is explained here: https://github.com/juju-solutions/bundletester#testsyaml
Unfortunately, apt_pkg is known to cause issues with virtualenvs, because it is non-trivial to recompile. Additionally, the automated test runner looks for a ".venv" target in the Makefile and if it doesn't find one, it creates a venv for you. In this case, you will need to create a venv yourself, using --system- site-packages so that apt_pkg can be accessed.
An example of doing this can be found here: http:// bazaar. launchpad. net/~tvansteenb urgh/charms/ trusty/ nova-compute/ fix-tests/ revision/ 75
Another option, though it is less recommended, is to create a tests.yaml file that instructs bundletester to not create a virtualenv at all. The tests.yaml file format is explained here: https:/ /github. com/juju- solutions/ bundletester# testsyaml