Skip to content
Robert Currie edited this page Nov 21, 2016 · 2 revisions

The new Ganga testing system is based upon py.test.

In order to run this you will need to have available all of the external python modules as described in the packages requirements.txt. (How you chose to do this is beyond the scope of this, but sufficed to say if you did pip install ganga you should have these available).

(In order to run the tests you must make sure that the ganga/python path is in your PYTHONPATH env parameter)

I'm assuming you've cd'd into your ganga/python folder from here on out as there is little reason to be developing from the tld of the package.

To run a test run:

py.test ./Ganga/test/GPI/someTest.py

To run all of the core integration tests run:

py.test Ganga/test/GPI

This will run all of the tests with minimal output and will display the result of each test. If a test fails you will see a trace of how it failed at the end of the py.test execution.

To fail and stop running on the first bad test run:

py.test -x Ganga/test/GPI

to display all output (stdout,stderr,etc) to the terminal whilst running:

py.test --capture=no Ganga/test/GPI

NB: this is very useful for checking the tests actually ran as expected with the integration tests.

Clone this wiki locally