|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Nose gives ImportError on Turbogears 1.0.7I've got some controller unit tests that use testutil for a TG1.0.7 project. I'm on Windows XP, Python 2.5.4. When I wrote them, they used to work when I used nosetests to run them, but now I'm getting an ImportError when trying to import turbogears. Specifically, it points to: \turbogears-1.0.7-py2.5.egg\turbogears\__init__.py line 5, from turbogears import config. An ImportError is raised, with the message, "cannot import name config." Now, in any python, Idle, or ipython session, I can import turbogears just fine. Also, the app runs fine, and when I run the test module directly, turbogears can be imported without problem. I was wondering if anyone has encountered this problem and/or knew what I could do to fix it. And unfortunately, I relied on nose heavily when writing my unittests, so I don't know how to run them on their own (I subclass testutil.DBTest for the test classes). So if someone knows a workaround without having to use nose, that would also be helpful. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Nose gives ImportError on Turbogears 1.0.7Min schrieb: > I've got some controller unit tests that use testutil for a TG1.0.7 > project. I'm on Windows XP, Python 2.5.4. When I wrote them, they used > to work when I used nosetests to run them, but now I'm getting an > ImportError when trying to import turbogears. Specifically, it points > to: > > \turbogears-1.0.7-py2.5.egg\turbogears\__init__.py line 5, > from turbogears import config. > > An ImportError is raised, with the message, "cannot import name > config." This error occurs usually when you have circular imports somewhere, but it's strange then, that your import works normally outside of running the tests. How do you run your tests? With "python setup.py test" or "nosetests [-vx]"? Also, is there a special reason why you still run TG 1.0.7 and not 1.0.9? Can you try if the latter works for you? Lastly, which nose version are you running? Have you tried different versions? Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Nose gives ImportError on Turbogears 1.0.7I'm using the "nosetests" command - I actually was not aware of the "python setup.py test" command. There's no particular reason that I'm using TG1.0.7 - the app was working fine for me, so I just never got around to upgrading. I'll make sure to try doing that. I'm running nose version 0.11.0, which is the latest, I believe. On Oct 31, 10:34 am, Christopher Arndt <chris.ar...@...> wrote: > Min schrieb: > > > I've got some controller unit tests that use testutil for a TG1.0.7 > > project. I'm on Windows XP, Python 2.5.4. When I wrote them, they used > > to work when I used nosetests to run them, but now I'm getting an > > ImportError when trying to import turbogears. Specifically, it points > > to: > > > \turbogears-1.0.7-py2.5.egg\turbogears\__init__.py line 5, > > from turbogears import config. > > > An ImportError is raised, with the message, "cannot import name > > config." > > This error occurs usually when you have circular imports somewhere, but > it's strange then, that your import works normally outside of running > the tests. > > How do you run your tests? With "python setup.py test" or "nosetests [-vx]"? > > Also, is there a special reason why you still run TG 1.0.7 and not > 1.0.9? Can you try if the latter works for you? > > Lastly, which nose version are you running? Have you tried different > versions? > > Chris You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Nose gives ImportError on Turbogears 1.0.7Alright, so upgrading to 1.0.9 seemed to have no effect. However, the command "python setup.py test" command works in running the unittests. Now, the only problem I'm having is that due to the quantity of the tests, I can't see all the results in the command prompt window after the tests are run. I did get around this by moving to the folder where a subset of the test files are saved, then calling the same command, using a slightly modified setup.py. However, I'm wondering if there's a way for me to catch the outputs to the command prompt (using "> log.txt" after the command doesn't seem to work) or to call the command while specifying which folder or files to look for tests in. Adding to the command the path to the folder with some tests in it didn't seem to do anything. On Nov 2, 10:32 am, Min <huc...@...> wrote: > I'm using the "nosetests" command - I actually was not aware of the > "python setup.py test" command. There's no particular reason that I'm > using TG1.0.7 - the app was working fine for me, so I just never got > around to upgrading. I'll make sure to try doing that. I'm running > nose version 0.11.0, which is the latest, I believe. > > On Oct 31, 10:34 am, Christopher Arndt <chris.ar...@...> wrote: > > > Min schrieb: > > > > I've got some controller unit tests that use testutil for a TG1.0.7 > > > project. I'm on Windows XP, Python 2.5.4. When I wrote them, they used > > > to work when I used nosetests to run them, but now I'm getting an > > > ImportError when trying to import turbogears. Specifically, it points > > > to: > > > > \turbogears-1.0.7-py2.5.egg\turbogears\__init__.py line 5, > > > from turbogears import config. > > > > An ImportError is raised, with the message, "cannot import name > > > config." > > > This error occurs usually when you have circular imports somewhere, but > > it's strange then, that your import works normally outside of running > > the tests. > > > How do you run your tests? With "python setup.py test" or "nosetests [-vx]"? > > > Also, is there a special reason why you still run TG 1.0.7 and not > > 1.0.9? Can you try if the latter works for you? > > > Lastly, which nose version are you running? Have you tried different > > versions? > > > Chris You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Nose gives ImportError on Turbogears 1.0.7On Mon, Nov 2, 2009 at 1:28 PM, Min <hucker@...> wrote:
You can redirect stderr with "2> log.txt", or redirect both stdout & stderr with: python setup.py test 2> log.txt 2>&1 BTW, does working with a subset of your tests help with the nose problem? Did you ever try different versions of nose? Does falling back to nose 0.9.3 resolve it? How about starting a clean virtualenv? There's no "turbogears" directory in your project, is there? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Nose gives ImportError on Turbogears 1.0.7Ah, thanks for the redirect trick. I only learned about stdout and stderr recently, and having these outputs in a text file is proving very helpful. Working with a subset of the tests doesn't fix the nose problem. I haven't tried rolling back nose to an earlier version, but I'll give that a shot. There isn't a 'turbogears' folder in my project, no. And I think I'd rather deal with not using nose to run the unittests than installing a new virtualenv... This project was put together rather haphazardly with no clear distinction between the backend and the frontend, resulting in the app requiring a very large number of different packages to be installed. On Nov 2, 9:16 pm, Ken Kuhlman <kskuhl...@...> wrote: > On Mon, Nov 2, 2009 at 1:28 PM, Min <huc...@...> wrote: > > > Alright, so upgrading to 1.0.9 seemed to have no effect. However, the > > command "python setup.py test" command works in running the unittests. > > Now, the only problem I'm having is that due to the quantity of the > > tests, I can't see all the results in the command prompt window after > > the tests are run. I did get around this by moving to the folder where > > a subset of the test files are saved, then calling the same command, > > using a slightly modified setup.py. > > > However, I'm wondering if there's a way for me to catch the outputs to > > the command prompt (using "> log.txt" after the command doesn't seem > > to work) or to call the command while specifying which folder or files > > to look for tests in. Adding to the command the path to the folder > > with some tests in it didn't seem to do anything. > > You can redirect stderr with "2> log.txt", or redirect both stdout & stderr > with: > python setup.py test 2> log.txt 2>&1 > > BTW, does working with a subset of your tests help with the nose problem? > Did you ever try different versions of nose? Does falling back to nose > 0.9.3 resolve it? > > How about starting a clean virtualenv? > > There's no "turbogears" directory in your project, is there? You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Nose gives ImportError on Turbogears 1.0.7On Tue, Nov 3, 2009 at 1:29 PM, Min <hucker@...> wrote:
I think you must have already figured this out, but there was a typo in my redirect. It should have read: python setup.py test > log.txt 2>&1 The first redirect sends sdtout to the log, the second appends stderr to stdout. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
| Free embeddable forum powered by Nabble | Forum Help |