I am using nose to run a bunch of test cases. I would like to record output of each case to separate files, and to know result[success/failure] of each case. unfortunately, I can not figure out how to do it with nose. can anybody provide some clues? thank you
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Firstly, this sounds like unusual usage, and may indicate that you should rethink your testing scheme.
I can think of a couple of ways to address this. The simplest would be to have each test log itself instead of having nose do it for you. If you have only a few tests, or only care to log the results of a few tests, this would definitely be the way to do it.
A more complex and general approach would be to write a nose plug-in that records the result of each test as it finishes. To do this, you'd want to write a plug-in that implements the afterTest() method.
This will append to a logfile named after your specific test a datestamp and True for success/False for failure. A couple of notes: