diff options
author | Sam Doran <sdoran@redhat.com> | 2019-08-09 20:58:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-09 20:58:46 +0200 |
commit | 2d266fbc87c6e1f2bd7bb887e254938278b8d2cc (patch) | |
tree | 8bcdf1db075e22bdf4cf758402974f231b7fe164 /test/units/executor | |
parent | Add sanity test for obsolete files. (diff) | |
download | ansible-2d266fbc87c6e1f2bd7bb887e254938278b8d2cc.tar.xz ansible-2d266fbc87c6e1f2bd7bb887e254938278b8d2cc.zip |
Fix unit tests to work with pytest >= 5.0 (#60246)
pytest made a change in the way the message from ExceptionInfo objects was returned.
https://docs.pytest.org/en/latest/changelog.html#pytest-5-0-0-2019-06-28
Diffstat (limited to 'test/units/executor')
-rw-r--r-- | test/units/executor/module_common/test_recursive_finder.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/units/executor/module_common/test_recursive_finder.py b/test/units/executor/module_common/test_recursive_finder.py index f2dc5e3183..0866623b7e 100644 --- a/test/units/executor/module_common/test_recursive_finder.py +++ b/test/units/executor/module_common/test_recursive_finder.py @@ -117,14 +117,14 @@ class TestRecursiveFinder(object): data = b'#!/usr/bin/python\ndef something(:\n pass\n' with pytest.raises(ansible.errors.AnsibleError) as exec_info: recursive_finder(name, data, *finder_containers) - assert 'Unable to import fake_module due to invalid syntax' in str(exec_info) + assert 'Unable to import fake_module due to invalid syntax' in str(exec_info.value) def test_module_utils_with_identation_error(self, finder_containers): name = 'fake_module' data = b'#!/usr/bin/python\n def something():\n pass\n' with pytest.raises(ansible.errors.AnsibleError) as exec_info: recursive_finder(name, data, *finder_containers) - assert 'Unable to import fake_module due to unexpected indent' in str(exec_info) + assert 'Unable to import fake_module due to unexpected indent' in str(exec_info.value) def test_from_import_toplevel_package(self, finder_containers, mocker): if PY2: |