diff --git a/changelogs/fragments/ansible-test-pytest-forked.yml b/changelogs/fragments/ansible-test-pytest-forked.yml new file mode 100644 index 00000000000..a8a58ce0a1c --- /dev/null +++ b/changelogs/fragments/ansible-test-pytest-forked.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test - Update unit tests to use the ``--forked`` option instead of the deprecated ``--boxed`` option. diff --git a/test/lib/ansible_test/_data/requirements/units.txt b/test/lib/ansible_test/_data/requirements/units.txt index d723a65fc66..d2f56d35a92 100644 --- a/test/lib/ansible_test/_data/requirements/units.txt +++ b/test/lib/ansible_test/_data/requirements/units.txt @@ -2,4 +2,5 @@ mock pytest pytest-mock pytest-xdist +pytest-forked pyyaml # required by the collection loader (only needed for collections) diff --git a/test/lib/ansible_test/_internal/commands/units/__init__.py b/test/lib/ansible_test/_internal/commands/units/__init__.py index dc3def32cfe..b4625ead4b4 100644 --- a/test/lib/ansible_test/_internal/commands/units/__init__.py +++ b/test/lib/ansible_test/_internal/commands/units/__init__.py @@ -237,7 +237,7 @@ def command_units(args): # type: (UnitsConfig) -> None for test_context, python, paths, env in test_sets: cmd = [ 'pytest', - '--boxed', + '--forked', '-r', 'a', '-n', str(args.num_workers) if args.num_workers else 'auto', '--color',