nose-devs/nose — Issue #172: Common interface for all test cases
Author: jpellerin
Created: 2011-12-14 16:02:40+00:00
State: closed

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.

Google Code Info:
Issue #: 7
Author: jpelle...@gmail.com
Created On: 2006-12-20T02:07:26.000Z
Closed On: 2007-06-05T01:46:03.000Z