Running tox -e py36 fails before any test is executed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Designate Charm |
Invalid
|
Undecided
|
Pedro Guimarães | ||
OpenStack Designate-Bind Charm |
Invalid
|
Undecided
|
Pedro Guimarães | ||
charms.openstack |
Fix Released
|
Undecided
|
Pedro Guimarães |
Bug Description
Running tox -e py36 fails to execute unit tests for Designate and Designate-Bind
Log of the error is:
--- import errors ---
Failed to import test module: unit_tests.
Traceback (most recent call last):
File "/home/
module = self._get_
File "/home/
__import_
File "/home/
import reactive.
File "src/reactive/
@reactive.
File "/home/
handler = Handler.get(action, endpoint_name)
File "/home/
cls.
File "/home/
self._action_id = _short_
File "/home/
filepath = os.path.
File "/home/
start = os.fspath(start)
TypeError: expected str, bytes or os.PathLike object, not MagicMock
It seems that hookenv has been mocked without any return_value set for charm_dir() and because of that, os.path.relpath ends up failing as it receives a MagicMock instance instead of an actual path.
One can reproduce this bug by cloning charm-designate from repo and running tox -e py36.
description: | updated |
Changed in charm-designate: | |
assignee: | nobody → Pedro Guimarães (pguimaraes) |
Changed in charm-designate-bind: | |
assignee: | nobody → Pedro Guimarães (pguimaraes) |
description: | updated |
Changed in charm-designate: | |
status: | In Progress → Invalid |
Changed in charm-designate-bind: | |
status: | In Progress → Invalid |
Fix proposed to branch: master /review. openstack. org/586204
Review: https:/