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
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
--
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
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
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
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
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
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
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
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
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
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
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
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
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.
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/
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
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
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
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
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'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
22 matches
Mail list logo