Closed mkalcok closed 2 years ago
This seems to be the same issue I ran into in #26 -- I have a workaround mentioned there, which is just to add
_, _, __name__ = __name__.rpartition(".")
in the relevant file (in my case tests/test_integration.py
)
I'm working on a charm which has following structure:
I'm not sure if it's important but I run functional tests via
tox
. All it really does is executepytest {toxinidir}/tests/functional
.Problem is that due to the presence of
__init__.py
files in my structure, when the pytest-operator tries to deploy my bundle, it constructs name of the model with dot-separated names of the directories. Final model name looks like this:and I get the following error/traceback:
Removing the
__init__.py
files gets rid of this problem but thenpytest
complains about relative imports. Also I think that main point is that algorithm which creates new model name uses forbidden characters to concatenate directories.EDIT: Including
test_build_and_deploy
step 'cause I forgot originaly.