diff options
author | noah <noah@656d521f-e311-0410-88e0-e7920216d269> | 2007-06-28 21:00:42 +0000 |
---|---|---|
committer | noah <noah@656d521f-e311-0410-88e0-e7920216d269> | 2007-06-28 21:00:42 +0000 |
commit | 5675aec4acb6c3a64ccf20609483629be37b920d (patch) | |
tree | 6551f058b382c6d90c6e664d1e9c0a7e2997d99a /pexpect | |
parent | 5be939e901a3633adb04e234aca4e8995613a7f4 (diff) | |
download | pexpect-5675aec4acb6c3a64ccf20609483629be37b920d.tar.gz |
Added a description of how the development tools are setup.
git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@481 656d521f-e311-0410-88e0-e7920216d269
Diffstat (limited to 'pexpect')
-rw-r--r-- | pexpect/DEVELOPERS | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/pexpect/DEVELOPERS b/pexpect/DEVELOPERS new file mode 100644 index 0000000..905fb23 --- /dev/null +++ b/pexpect/DEVELOPERS @@ -0,0 +1,46 @@ + +First off, you need to source the environment file provided in the root of the +development directory. + + . test.env + +This sets the PYTHONPATH to the Pexpect development root directory. This way +the unit tests and python interpreter will import the development version of +pexpect instead of any older versions that you may have installed on the +system. Running all unit tests is as simple as sourcing test.env and then +running tools/testall.py. + +The Pyunit tests are all located in the tests/ directory. To add a new unit +test all you have to do is create the file in the tests/ directory with a +filename in this format: + + test_*.py + +The testall.py script in the tools/ directory will automatically add all +test_*.py files to the test suite. To create a new unit test follow the example +of one of the other test_*.py scripts. Basically, a new unit test will follow +this template: + +<pre> +#!/usr/bin/env python +import pexpect +import unittest +import PexpectTestCase + +# 1. Derive your test case class from PexpectTestCase.PexpectTestCase. +# 2. At the end of this script add your test case class to the suite using +# unittest.MakeSuite. +# 3. All test case methods should be named like test_*. +class TestCaseFoo (PexpectTestCase.PexpectTestCase): + def test_case (self): + assert (False), "This is an example template." + def test_case_something_else (self): + assert (False), "This is an example template." + +if __name__ == '__main__': + unittest.main() + +suite = unittest.makeSuite(TestCaseFoo,'test') +</pre> + + |