Interpolating Ansible jinja in testinfra
One of idiosyncrasies of Ansible with pytest (testinfra) is that whilst you have access to inventory, any Jinja there will mess up you badly, as you will have a literal value with mustaches instead of expected interpolation.