This guide is about development of wxPython's unit test suite. It assumes you have read GUI Unit Testing Project, which contains more basic information. To run the unit test suite, see the Unit Testing Quick Start Guide page.
Unit Test Development
This page is currently under construction. If you have any specific questions about the unit test suite, or would like to know how or why something works, please don't hesitate to contact email@example.com
Currently the main thrust of development work is on verifying that all test failures across all platforms expose a meaningful bug in wx, rather than a bug in the unit test suite. Once this is complete, the suite will begin showing its usefulness, in keeping regressions at bay and verifying correct behavior of an implementation. At this point the unit test suite
The second phase involves expanding the unit test suite's coverage, by writing additional tests for classes and methods not currently under test. Below is the general procedure for adding tests.
Procedure for Adding Tests
- Check out the unit test suite into a local sandbox
- Identify a method or class whose behavior you'd like to have verified
- Write an appropriate test for the method or class (see below for details)
- Run the whole test suite with your changes
- Make sure your test doesn't break any other part of the test suite
- If your tests pass, this is probably a good thing; verify that your tests encapsulate the expected behavior of the unit you're testing
- If your tests fail, this may not be a bad thing; check if the test failure is a result of a bug in your test's implementation
The test failure may represent some bug or inconsistency of behavior in wx; if this is the case, finding it is the highest purpose of writing tests
- At this point you have a test suite working copy with local modifications. Create a patch file
Submit a patch to the wxPython patch tracker
<things you should include in a patch report>
Adding tests to an already tested class
Adding a new test class
Two spaces above 'if name == "main":' line.
Use double quotes except where inappropriate.
Use underscores rather than camelCase for variable naming.
Use lowerCamelCase for test method names.
Each file has a docstring...
<write about docstrings>