On 2/11/21 8:15 AM, 'Felix Fontein' via Ansible Development wrote:
Hi,

I'm starting to migrate my module project into a collection and I'm
running into issues with missing test utility functions like:

tests/unit/plugins/lookup/test_pfsense.py:10: in <module>
      from units.compat.mock import patch
E   ImportError: No module named units.compat.mock

tests/unit/plugins/modules/test_pfsense_aggregate.py:13: in <module>
      from units.modules.utils import set_module_args
E   ImportError: No module named units.modules.utils

  From poking around in the various collection repositories it appears
that many collections are now carrying local copies of these.  Is
this really the plan here?  It seems - not ideal.

I'm not very happy about this either. My personal recommendation
(slightly biased ;) ) for collections would be to import them from
https://galaxy.ansible.com/community/internal_test_utils /
https://github.com/ansible-collections/community.internal_test_tools.
That of course requires you to install that collection for unit tests,
though...

Thanks, I've used that in my project. I wonder if a tests dependency tag is in order for galaxy.yml?

--
Orion Poplawski
he/him/his - surely the least important thing about me
Manager of NWRA Technical Systems          720-772-5637
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       or...@nwra.com
Boulder, CO 80301                 https://www.nwra.com/

--
You received this message because you are subscribed to the Google Groups "Ansible 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/42274651-6d98-2578-dbb1-15fca8c0ebda%40nwra.com.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to