nosetests vs. relative imports?

2013-12-24 Thread Roy Smith
Environment: Ubuntu Linux 12.04 (precise) Python 2.7.3 I have a package (i.e. a directory with a __init__.py file). In that directory, I have files math.py and test_math.py; test_math.py contains the single line: from .math import EMA If I run on the command line, "nosetests test_ma

Re: Nosetests

2013-09-29 Thread Terry Reedy
On 9/29/2013 5:28 PM, melw...@gmail.com wrote: I was actually able to fix the code and run it, now i need to run tests but idk what tests to write or how to even write it. Two of us already gave you suggestions. I gave you a detailed re-write. [snip hard to test code] -- Terry Jan Reedy --

Re: Nosetests

2013-09-29 Thread melwin9
I was actually able to fix the code and run it, now i need to run tests but idk what tests to write or how to even write it. [code] import random intro = 'I have chosen a number from 1-10' request = 'Guess a number: ' responseHigh = "That's too high." responseLow = "That's too low." responseCo

Re: Nosetests

2013-09-26 Thread Steven D'Aprano
On Thu, 26 Sep 2013 21:20:52 -0700, melwin9 wrote: > I modified the guess.py file but am unable to run it, What does that mean? How do you try to run it? What happens when you do? -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Nosetests

2013-09-26 Thread melwin9
I modified the guess.py file but am unable to run it, how do I go about writing tests for this. import random guessesTaken = 0 number = random.randint(1, 10) intro = 'I have chosen a number from 1-10' request = 'Guess a number: ' responseHigh = "That's too high." responseLow = "That's too lo

Re: Nosetests

2013-09-26 Thread melwin9
The question was more like what tests should I be writing, fine if I remove the pexpect test I tried the test_guess & test_guesstoolow and still unable to get it to work. So if i Want to ask for a number and typed a number which is at random indicated by the top of the code, how do I proceed on

Re: Nosetests

2013-09-26 Thread Roy Smith
In article , melw...@gmail.com wrote: > Initially I was shown pexpect, leaving that there, Can i make up 5 tests? I > tried tests two different ways and no luck. What am I supposed to be writing > up when I do a test and is there a particular way I can/should be referencing > it back to its ma

Re: Nosetests

2013-09-26 Thread melwin9
Initially I was shown pexpect, leaving that there, Can i make up 5 tests? I tried tests two different ways and no luck. What am I supposed to be writing up when I do a test and is there a particular way I can/should be referencing it back to its main file? THis is what I have for the test_guess

Re: Nosetests

2013-09-25 Thread Roy Smith
In article <32f7bdcb-97e5-4a1c-a2c8-ab91e4052...@googlegroups.com>, melw...@gmail.com wrote: > Not sure How to proceed on with writing a few more tests with if statement to > test if the value is low or high. I was told to try a command line switch > like optparse to pass the number but not sur

Nosetests

2013-09-25 Thread melwin9
Hello, I am trying to write a few tests for a random input number game but not too sure how to proceed on. I am following the Python Game from http://inventwithpython.com/chapter4.html Started the tests with a file test_guess.py from unittest import TestCase import pexpect as pe import guess

Re: Weird import failure with "nosetests --processes=1"

2012-11-29 Thread Roy Smith
In article <50b78e26$0$6945$e4fe5...@news2.news.xs4all.nl>, Hans Mulder wrote: > That is baffling indeed. It looks like nose is adding some > directory to sys.path, which contains a module pyza.py instead > of a package. We finally figured it out. As it turns out, that's pretty close. > Anot

Re: Weird import failure with "nosetests --processes=1"

2012-11-29 Thread Hans Mulder
a.models >>>> print pyza.models > '/home/roy/deploy/current/pyza/models/__init__.pyc'> >>>> > > But when I run nosetests in parallel mode, the import fails in a way > which has me baffled. What's going on here? > > $ nosetests --proce

Weird import failure with "nosetests --processes=1"

2012-11-28 Thread Roy Smith
2, 05:14:39) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pyza.models >>> print pyza.models >>> But when I run nosetests in parallel mode, the import fails in a way wh

Re: pydb output vanishes when running nosetests doctests

2009-05-18 Thread Diez B. Roggisch
jcervidae wrote: > Hi Pythonistas: > > When pydb.debugger() is launched from within my code or for some other > reason pydb starts from inside a nosetests or doctest, I do not see > any output from it. It appears the test has hung but it hasn't. If I > type commands pydb

pydb output vanishes when running nosetests doctests

2009-05-18 Thread jcervidae
Hi Pythonistas: When pydb.debugger() is launched from within my code or for some other reason pydb starts from inside a nosetests or doctest, I do not see any output from it. It appears the test has hung but it hasn't. If I type commands pydb obeys them I just can't see the results.

Re: strange permission issue with nosetests

2008-11-20 Thread Roel Schroeven
ine he needs to change permission? And it is strange that the first time I didn't need to change anything. You can also nosetests --exe; with that option, nose will also include executable files (see the section "nosetests usage" on the website (http://somethingaboutorange.com/mrl/

Re: strange permission issue with nosetests

2008-11-20 Thread Ben Finney
Mr.SpOOn <[EMAIL PROTECTED]> writes: > Mmm it seems strange to me. I mean, there isn't any reference to this > on the site. How would one imagine he needs to change permission? And > it is strange that the first time I didn't need to change anything. This seems now to have moved to be more about

Re: strange permission issue with nosetests

2008-11-20 Thread Mr . SpOOn
On Thu, Nov 20, 2008 at 13:34, Ben Finney <[EMAIL PROTECTED]> wrote: > Mr.SpOOn <[EMAIL PROTECTED]> writes: > >> Searching on google I found this: http://www.siafoo.net/article/61 >> He had the same issue and said to change permission of the file to 664. > > Unit test modules, which are primarily m

Re: strange permission issue with nosetests

2008-11-20 Thread Ben Finney
Mr.SpOOn <[EMAIL PROTECTED]> writes: > Searching on google I found this: http://www.siafoo.net/article/61 > He had the same issue and said to change permission of the file to 664. > > I tried and it worked. > Is that normal? Why does it happen? If a file is meant to be run as a command or progra

strange permission issue with nosetests

2008-11-20 Thread Mr . SpOOn
Hi, I'm trying the nose testing package. I've just started reading the tutorial and I had a problem with the first simple example. This is the test: def test_b(): assert 'b' == 'b' In the same directory I gave the command nosetests and it runs the test. Then I

Re: I can't get minimock and nosetests to play nice

2007-10-22 Thread John J. Lee
Matthew Wilson <[EMAIL PROTECTED]> writes: > I'm curious if anyone has ever tried using nosetests along with > minimock. This has nothing to do with nose. > I'm trying to get the two to play nice and not making progress. I > also wonder if I'm using minimock i

I can't get minimock and nosetests to play nice

2007-10-18 Thread Matthew Wilson
I'm curious if anyone has ever tried using nosetests along with minimock. I'm trying to get the two to play nice and not making progress. I also wonder if I'm using minimock incorrectly. Here's the code I want to test, saved in a file dtfun.py. class Chicken(obj