Skip to content

Instantly share code, notes, and snippets.

@tadeboro
Created August 2, 2020 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadeboro/325902b00a5f66b7ae31e16cfdc24fdd to your computer and use it in GitHub Desktop.
Save tadeboro/325902b00a5f66b7ae31e16cfdc24fdd to your computer and use it in GitHub Desktop.
ansible-test units output using pytest 6.0.1
$ ansible-test units --python 3.8 tests/unit/modules/test_asset.py
WARNING: PyYAML will be slow due to installation without libyaml support for interpreter: /home/tadej/xlab/sensu/venvt/bin/python
Unit test with Python 3.8
================================================= test session starts =================================================
platform linux -- Python 3.8.3, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
rootdir: /home/tadej/xlab/sensu/ansible_collections/sensu/sensu_go/tests/unit/modules, configfile: ../../../../../../venvt/lib64/python3.8/site-packages/ansible_test/_data/pytest.ini
plugins: xdist-1.34.0, forked-1.3.0, mock-3.2.0
gw0 [0] / gw1 [0] / gw2 [0] / gw3 [0] / gw4 [0] / gw5 [0] / gw6 [0] / gw7 [0]
======================================================= ERRORS ========================================================
___________________________________________ ERROR collecting test_asset.py ____________________________________________
ImportError while importing test module '/home/tadej/xlab/sensu/ansible_collections/sensu/sensu_go/tests/unit/modules/test_asset.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/unit/modules/test_asset.py:12: in <module>
from .common.utils import (
E ImportError: attempted relative import with no known parent package
================================================== warnings summary ===================================================
/home/tadej/xlab/sensu/venvt/lib64/python3.8/site-packages/_pytest/junitxml.py:446
/home/tadej/xlab/sensu/venvt/lib64/python3.8/site-packages/_pytest/junitxml.py:446: PytestDeprecationWarning: The 'junit_family' default value will change to 'xunit2' in pytest 6.0. See:
https://docs.pytest.org/en/stable/deprecations.html#junit-family-default-value-change-to-xunit2
for more information.
_issue_warning_captured(deprecated.JUNIT_XML_DEFAULT_FAMILY, config.hook, 2)
-- Docs: https://docs.pytest.org/en/stable/warnings.html
- generated xml file: /home/tadej/xlab/sensu/ansible_collections/sensu/sensu_go/tests/output/junit/python3.8-units.xml -
=============================================== short test summary info ===============================================
ERROR tests/unit/modules/test_asset.py
============================================= 1 warning, 1 error in 0.68s =============================================
ERROR: Command "pytest --boxed -r a -n auto --color yes -p no:cacheprovider -c /home/tadej/xlab/sensu/venvt/lib64/python3.8/site-packages/ansible_test/_data/pytest.ini --junit-xml /home/tadej/xlab/sensu/ansible_collections/sensu/sensu_go/tests/output/junit/python3.8-units.xml --strict-markers tests/unit/modules/test_asset.py" returned exit status 1.
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from ansible_collections.sensu.sensu_go.plugins.module_utils import (
errors, utils,
)
from ansible_collections.sensu.sensu_go.plugins.modules import asset
from .common.utils import (
AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args,
)
class TestDoDiffer:
def test_equal_assets_with_none_values(self):
assert asset.do_differ(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment