[Pydev-code] First cut at integrating pyUnit into pyDev
Brought to you by:
fabioz
From: Grig G. <gr...@gh...> - 2004-09-13 14:32:46
|
Hi, guys I'm attaching 2 files that both need to go into org.python.pydev.debug. One of them is plugin.xml and the other one is PythonTestActionDelegate.java which needs to go into src/org/python/pydev/debug/ui/actions. I added a 'pyUnit Test..." menu item and corresponding action to the Python->Run/Debug menu which pops up when you right-click a Python file. The action runs a separate python process (and assumes it can find it on the path), feeds it a small python script that imports unittest and runs all the tests it finds in the selected file, then prints the output to stdout. This was done more like a proof-of-concept. In the future, I intend to mimic as closely as possible the behavior of running jUnit tests in the Java perspective, so I'll be adding a view, a green/red bar etc. But I thought I'd send you what I have so far and maybe you'll find it useful. This is a sample output, from an example test included with pyUnit: testAppend (listtests.ListTestCase) ... ok Check count() within heterogeneous list ... ok testIndexing (listtests.ListTestCase) ... ok testSlicing (listtests.ListTestCase) ... ok testAppend (listtests.UserListTestCase) ... ok Check count() within heterogeneous list ... ok testIndexing (listtests.UserListTestCase) ... ok testSlicing (listtests.UserListTestCase) ... ok ---------------------------------------------------------------------- Ran 8 tests in 0.010s OK Also, I'm not verifying that the selected Python file actually contains test cases. This is another TODO item. If you select a file which doesn't contain test cases, you get ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK Grig |