mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 11:27:36 -02:30
Fix sanity errors for collections
This commit is contained in:
@@ -15,6 +15,8 @@ from requests.models import Response, PreparedRequest
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible.module_utils.six import raise_from
|
||||
|
||||
from awx.main.tests.functional.conftest import _request
|
||||
from awx.main.models import Organization, Project, Inventory, JobTemplate, Credential, CredentialType, ExecutionEnvironment, UnifiedJob
|
||||
|
||||
@@ -184,7 +186,7 @@ def run_module(request, collection_import):
|
||||
try:
|
||||
result = json.loads(module_stdout)
|
||||
except Exception as e:
|
||||
raise Exception('Module did not write valid JSON, error: {0}, stdout:\n{1}'.format(str(e), module_stdout)) from e
|
||||
raise_from(Exception('Module did not write valid JSON, error: {0}, stdout:\n{1}'.format(str(e), module_stdout)), e)
|
||||
# A module exception should never be a test expectation
|
||||
if 'exception' in result:
|
||||
if "ModuleNotFoundError: No module named 'tower_cli'" in result['exception']:
|
||||
|
||||
@@ -47,4 +47,4 @@ def test_create_project_copy_from(run_module, admin_user, organization, silence_
|
||||
dict(name=proj_name, copy_from='foo', scm_type='git', wait=False),
|
||||
admin_user,
|
||||
)
|
||||
silence_warning.assert_called_with(f"A project with the name {proj_name} already exists.")
|
||||
silence_warning.assert_called_with("A project with the name {0} already exists.".format(proj_name))
|
||||
|
||||
Reference in New Issue
Block a user