| Issue 320: | Problem with test infrastructure | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. Modify the pymt/tests directory to become a Python package 2. Create an Eclipse launch configuration for pymt/tests/init.py 3. Add the following command line arguments tests.mymodule.py unittest_mytest 4. Run the launch configuration What is the expected output? What do you see instead? I expect to see the test launched. Instead I get an AttributeError at line 71 in init.py: getattr(mod, testname)() This happens because __import__ returns the top level import object which is for the package tests, not the module tests.mymodule so the method unittest_mytest is not found. A fix that works whether the tests dirctory is a Python package or not is to add a line after __import__ mod = sys.modules[modname] which will retrieve the module needed. What version of the product are you using? On what operating system? Please provide any additional information below. you can find a patch for this in my Github fork (jfgossage/pymt). It is commit "2606c9ab68338aae4c017040c78217c3d5556928"
Aug 17, 2010
Thanks John !
Status:
Done
|
Owner: txprog
Labels: Milestone-0.5.1