dimanche 18 septembre 2016

How can I install requirements before my integration tests?

I'm trying to add an integration command to my setup.py which sets an environment variable, runs unit and integration tests, then resets the env variable.

My problem is that I can't figure out how to install the requirements first like setup.py test does. Here's what I have so far.

class integration(test):

    def run(self):
        start_state = os.environ.get("DO_INTEGRATION", None)
        os.environ["DO_INTEGRATION"] = "TRUE"

        pytest.main('myfolder')

        if start_state:
            os.environ["DO_INTEGRATION"] = start_state
        else:
            del os.environ["DO_INTEGRATION"]


setup(
    cmdclass = {'integration': integration},
    ...
    )

Aucun commentaire:

Enregistrer un commentaire