You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my collection I define the molecule tests like this (pretty much copy paste from the readme):
% cat tests/test_molecule.py
"""Tests for molecule scenarios."""
from __future__ import absolute_import, division, print_function
from pytest_ansible.molecule import MoleculeScenario
def test_molecule(molecule_scenario: MoleculeScenario) -> None:
"""Run molecule for each scenario.
:param molecule_scenario: The molecule scenario object
"""
proc = molecule_scenario.test()
assert proc.returncode == 0
Now, when the testsuite runs, it seems to copy the collection to collections/ansible_collections/<namespace>/<name>, resulting in the following output:
See how the tests are duplicated for collections/ansible_collections/namespace/collection/tests/test_molecule.py and tests/test_molecule.py?
Additionally, re-running the tests now fails (when executed on a non-ephemeral node, like a laptop):
=============================================================================================================== ERRORS ================================================================================================================
_______________________________________________________________________________________________ ERROR collecting tests/test_molecule.py _______________________________________________________________________________________________
import file mismatch:
imported module 'test_molecule' has this __file__ attribute:
/home/evgeni/Devel/namespace.collection/collections/ansible_collections/namespace/collection/tests/test_molecule.py
which is not the same as the test file we want to collect:
/home/evgeni/Devel/namespace.collection/tests/test_molecule.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
======================================================================================================= short test summary info =======================================================================================================
ERROR tests/test_molecule.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================================================== 1 error in 0.08s ===========================================================================================================
The text was updated successfully, but these errors were encountered:
In my collection I define the molecule tests like this (pretty much copy paste from the readme):
Now, when the testsuite runs, it seems to copy the collection to
collections/ansible_collections/<namespace>/<name>
, resulting in the following output:See how the tests are duplicated for
collections/ansible_collections/namespace/collection/tests/test_molecule.py
andtests/test_molecule.py
?Additionally, re-running the tests now fails (when executed on a non-ephemeral node, like a laptop):
The text was updated successfully, but these errors were encountered: