Hi Chris, On Fri, May 13, 2016 at 2:35 PM Chris Spencer <[email protected]> wrote:
> How do you configure Pytest to create a new Vagrant VM before each test > and destroy it afterwards? > I've not done something similar myself, but I would implement this feature as a fixture, which would create a vagrant vm and destroy it afterwards. > I'm trying to test a sysadmin tool based on Fabric ( > http://www.fabfile.org/), and so the tests need a fresh target server in > a known state to login to. > > I tried implementing a Pytest plugin, similar to the Fabtools project ( > https://github.com/ronnix/fabtools/blob/master/fabtools/tests/functional_tests/conftest.py) > but it's unreliable. Each test seems to pass when I run them separately, > but when I run all my tests together, there's some bug that's preventing > the VM from being destroyed and re-created properly, causing many tests to > fail when the previous test leaves the VM in an unexpected state. > Perhaps can you post the error you are getting exactly? Also others might have more experience with starting/shutdown vagrant from within python. Cheers, Bruno.
_______________________________________________ pytest-dev mailing list [email protected] https://mail.python.org/mailman/listinfo/pytest-dev
