From a1edb61ce7a645019496273cfe77b33cd3e64a2d Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 21 Feb 2024 10:08:54 -0800 Subject: [PATCH] ansible-test - Add work-around for pytest>=8 errors (#82723) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ansible-test - Add work-around for pytest>=8 errors * Update changelogs/fragments/ansible-test-pytest-8.yml Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) --- changelogs/fragments/ansible-test-pytest-8.yml | 2 ++ test/lib/ansible_test/_internal/commands/units/__init__.py | 1 + 2 files changed, 3 insertions(+) create mode 100644 changelogs/fragments/ansible-test-pytest-8.yml diff --git a/changelogs/fragments/ansible-test-pytest-8.yml b/changelogs/fragments/ansible-test-pytest-8.yml new file mode 100644 index 00000000000..de863194c38 --- /dev/null +++ b/changelogs/fragments/ansible-test-pytest-8.yml @@ -0,0 +1,2 @@ +minor_changes: + - ansible-test - Add a work-around for permission denied errors when using ``pytest >= 8`` on multi-user systems with an installed version of ``ansible-test``. diff --git a/test/lib/ansible_test/_internal/commands/units/__init__.py b/test/lib/ansible_test/_internal/commands/units/__init__.py index 7656eebf5b4..94272627cc9 100644 --- a/test/lib/ansible_test/_internal/commands/units/__init__.py +++ b/test/lib/ansible_test/_internal/commands/units/__init__.py @@ -261,6 +261,7 @@ def command_units(args: UnitsConfig) -> None: '--junit-xml', os.path.join(ResultType.JUNIT.path, 'python%s-%s-units.xml' % (python.version, test_context)), '--strict-markers', # added in pytest 4.5.0 '--rootdir', data_context().content.root, + '--confcutdir', data_context().content.root, # avoid permission errors when running from an installed version and using pytest >= 8 ] # fmt:skip if not data_context().content.collection: