My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 320: Problem with test infrastructure
1 person starred this issue and may be notified of changes. Back to list
Status:  Done
Owner:  txprog
Closed:  Aug 2010


 
Reported by jgoss...@gmail.com, Aug 17, 2010
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
Project Member #1 txprog
(No comment was entered for this change.)
Status: Accepted
Owner: txprog
Labels: Milestone-0.5.1
Aug 17, 2010
Project Member #2 txprog
Thanks John !
Status: Done

Powered by Google Project Hosting