AWS provides support for installing python 3.11 in Amazon Linux 2023 containers.
However it isn't at all obvious how you install and run a compatible pytest in this case.
For example, if you do this:
dnf install -y pytest
the version of pytest installed is the 3.9 version which is compatible with the so-called system version of Python which is 3.9 but is not compatible with python3.11 installed via the supported method.
So what is the canonical way for installing a version of pytest which is compatible with the python3.11 as installed in the manner recommended by AWS?