pytest error message

Hi

When I run the following command

pytest -r a -fulltrace --color yest my_new_test_module.py

I get the following error message.

============================= test session starts ==============================
platform linux – Python 3.4.5, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /root/work/mymoduletests, inifile:
collected 0 items / 1 errors

=========================== short test summary info ============================
ERROR my_new_test_module.py
==================================== ERRORS ====================================
____________________ ERROR collecting my_new_test_module.py ____________________
[31mImportError while importing test module ‘/root/work/mymoduletests/my_new_test_module.py’.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
my_new_test_module.py:63: in
from ansible.module_utils.basic import AnsibleModule
E ImportError: No module named ‘ansible’ [0m
!!! Interrupted: 1 errors during collection !!!
=========================== 1 error in 0.13 seconds ============================

my_new_test_module.py is

#!/usr/bin/python

ANSIBLE_METADATA = {
‘metadata_version’: ‘1.1’,
‘status’: [‘preview’],
‘supported_by’: ‘community’
}

DOCUMENTATION = ‘’’

How are you arranging for ansible to be in your PYTHONPATH?

-Toshio

$PYTHONPATH is empty. Should this be filled in with something?

That depends. Did you install ansible into system site-packages? Or did you check it out from source?