Mon Sep 11 14:58:37 2006
Ticket #89 (assigned)
would like common interface for all test wrapper objects
| Priority: | normal | Reporter: | kumar mcmillan <support-forums5@farmdev.com> |
|---|---|---|---|
| Severity: | enhancement | Assigned to: | jpellerin (accepted) |
| Component: | nose | Status: | assigned |
| Version: | Resolution: | ||
| Milestone: | 0.10 | Keywords: |
Description by kumar mcmillan <support-forums5@farmdev.com>:
It would be convenient/efficient/and future-safe to access all of nose's internal test wrappers with a common interface. That is, convenient for the nose-watch plugin ;)
Here is an initial idea, open to suggestions. I should point out that these are the only things that nose-watch needs to access, so a complete interface might want more.
- wrapper.getTestObject()
- the actual test (i.e. FunctionTestCase.testFunc or TestModule.module or unittest.TestCase._'_class_'_)
- wrapper.getTestFile()
- this one has proven itself really tricky and maybe nose has a better way to do it since it is already looking for tests in the filesystem. Currently I am working around unloadable modules by overloading the load_source() method in ihooks.Hooks. There is also a big problem that I'm not sure is solvable in aliased modules (i.e. "from main import foo" when when foo.py exists in main/foo/foo.py, concealed by main/foo/init.py). I think inspect.getfile() is the one to blame for that, but I haven't looked into it too far other than knowing it's not working how I would like it.
- wrapper.getTestAddress()
- get a string "address" of a test. That is, a name that could be put on the command line of a nosetests call to run this test again. I'm thinking that any unittest.TestCase method could only return the filename of its module?
We should talk before you start work on this ... or perhaps I will just add a patch or two to this ticket if I get around to it first. I'll wait until 0.9.1 is out the door.
Changelog
Tue Nov 21 09:30:00 2006: Modified by jpellerin
- milestone changed from 1.0 to 0.10
- status changed from new to assigned
