Hello all, I'm a good way to porting all the tests to the new framework. I only need to port blast_db and add the changes that were made while I was porting. I have not yet touched the megatests.
You can pull my version from here. git clone http://atlas.bx.psu.edu/git/pygr-test2.git I've also fiddled around in the main repository and added some functionality that I think is important to have. The tests do not make directly use of these, so you should be able to run the tests in tests2 even in the main trunk. Here are my additions: - A logging module (see pygr.logger) upon importing it creates debug, info, warn and error loggers, you can use them like logger.info ("hello") etc. The nicest thing about them is that these functions will print the calling function's name, thus makes it easy to find out where the logging information comes from. You also have the option of turning off messages (say debug ones). Plus one may register new handlers or override the formatters. All printf >>stderr, type of outputs should be migrated to this (or another) logger. I will do that if this logger makes it into the main trunk. I have some pedantic pet peeves, libraries printing various messages without being able to silence them is one of them, so that is my motivation there. - Mysql configuration should be read off not from main configurations but from a local configuration file from the tests2 folder (called mysql.cnf). That way you can point it to other servers and you're not going to accidentally hammer away at a production site. This also makes the code a lot simpler as you don't need to add the search from various locations. The current behavior that I added falls back to a local configuration file if it does not find the other locations. - added two patches one for downloading files, (flag should be 'wb' not just 'b') and another where a seqdb attribute is incorrect, caught it with testing ;-) Here is the new README.txt for the tests. ----------------- README.txt ------------ General guide ============= The default behavior is to add the source directory to the import path. Developers are expected to build the extension libraries in place with: python setup.py build_ext -i See the section on flags on how to customize this behavior. Typical use cases ================== Test modules end with _test.py suffix. Each test module may be executed on its own and will produce high verbosity output. The runtests.py script may be used to run all test modules or a subset of them. Run all tests (modules that end in _test.py): python runtest.py To run one test you can execute the file itself: python seqdb_test.py Other way to run one test is via the runtest script: python runtest.py seqdb_test.py Run two tests: python runtest.py seqdb_test.py sequence_test.py Run all tests excluding seqdb_test: python runtest.py -x seqdb_test.py Change verbosity levels: python runtest.py -v 2 You may use full file names, or module names. Flags ===== To see the flags execute the script with the -h flag python runtest.py -h Usage: runtest.py [options] Options: -h, --help show this help message and exit -n do not alter the python import path -b use the platform specific build directory -x excludes the files that are listed -v VERBOSITY sets the verbosity (0, 1, or 2) --port=PORT sets the port information for the XMLRPC server --pygrdatapath=PYGRDATAPATH sets the pygraphdata path for the XMLRPC server --downloadDB=DOWNLOADDB sets the downloadDB shelve for the XMLRPC server --resources=RESOURCES sets the downloadable resources, separate multiple ones with a : symbol Notes ===== - The test specific connection information is read out from the mysql.cnf file in the tests2 directory (for now it is last resort but should be the primary way) - The main test runner will delete the temp directory before each run. - Each test module must implement the get_suite() function that returns a unittest test suite --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pygr-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pygr-dev?hl=en -~----------~----~----~----~------~----~------~--~---
