Re: Python Unit Tests

2013-09-30 Thread Terry Reedy
On 9/30/2013 12:19 AM, melw...@gmail.com wrote: Hi Dave, Yeah I found the silly mistake lol thanks for that. making progress. Guess a number: 5 That's too high. Guess a number: 4 That's too high. Guess a number: 3 Traceback (most recent call last): File guess.py, line 34, in module

Re: Python Unit Tests

2013-09-30 Thread melwin9
Lol, im starting to get the hang out of, onto the next hurdle, i looked up the error and it says the data is none? Traceback (most recent call last): File guess.py, line 34, in module main(random.randint(1, 10)) File guess.py, line 27, in main guess, tries = getguess(target,

Re: Python Unit Tests

2013-09-30 Thread MRAB
On 30/09/2013 20:54, melw...@gmail.com wrote: Lol, im starting to get the hang out of, onto the next hurdle, i looked up the error and it says the data is none? Traceback (most recent call last): File guess.py, line 34, in module main(random.randint(1, 10)) File guess.py, line 27,

Re: Python Unit Tests

2013-09-30 Thread Dave Angel
On 30/9/2013 15:54, melw...@gmail.com wrote: Lol, im starting to get the hang out of, onto the next hurdle, i looked up the error and it says the data is none? Traceback (most recent call last): File guess.py, line 34, in module main(random.randint(1, 10)) File guess.py, line 27,

Re: Python Unit Tests

2013-09-30 Thread Terry Reedy
On 9/30/2013 3:54 PM, melw...@gmail.com wrote: Lol, im starting to get the hang out of, onto the next hurdle, i looked up the error and it says the data is none? Traceback (most recent call last): File guess.py, line 34, in module main(random.randint(1, 10)) File guess.py, line 27,

Re: Python Unit Tests

2013-09-29 Thread melwin9
Hi Terry Dave, Thanks for the suggestions. I am running Python 2.7 and when I tried the code above it said def main(target) - invalid syntax. I was told to use pexpect by my professor which is why I started to use that for the tests. As for the test suggestions, I will try to come up wit

Re: Python Unit Tests

2013-09-29 Thread Steven D'Aprano
On Sun, 29 Sep 2013 18:46:30 -0700, melwin9 wrote: Hi Terry Dave, Thanks for the suggestions. I am running Python 2.7 and when I tried the code above it said def main(target) - invalid syntax. Did you fix the invalid syntax? Until you fix it, you're blocked. As a programmer, it is

Re: Python Unit Tests

2013-09-29 Thread melwin9
Hi Dave, Yeah I found the silly mistake lol thanks for that. making progress. Guess a number: 5 That's too high. Guess a number: 4 That's too high. Guess a number: 3 Traceback (most recent call last): File guess.py, line 34, in module main(random.randint(1, 10)) File guess.py, line 29,

Re: Python Unit Tests

2013-09-28 Thread Dave Angel
On 28/9/2013 00:52, melw...@gmail.com wrote: Hey, What version of Python are you using? I'll assume 2.7, but you really should specify it (and any other meaningful environment dependencies) in your original query, the beginning of your thread. For 2.7, the docs for unittest are at:

Re: Python Unit Tests

2013-09-28 Thread Terry Reedy
On 9/28/2013 12:52 AM, melw...@gmail.com wrote: [How can I test...] 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. responseCorrect = That's right! goodbye = 'Goodbye and thanks for playing!'

Python Unit Tests

2013-09-27 Thread melwin9
Hey, How do i go about coming up/coding tests for this program below. Not sure how to even approach writing about 5 tests for it. Initially I had this for the test but its not working well. Test was name test_guess.py (Code Below) [code] from unittest import TestCase import pexpect as pe

Re: Python unit tests.

2009-04-16 Thread alessiogiovanni . baroni
On 15 Apr, 16:18, s...@pobox.com wrote:     how do I read the info athttp://coverage.livinglogic.de? For     example, inhttp://coverage.livinglogic.de/Objects/funcobject.c.html,     the count field, what it means? Most likely it's the number of times that line was executed.  Strong support

Python unit tests.

2009-04-15 Thread alessiogiovanni . baroni
Hi to all, how do I read the info at http://coverage.livinglogic.de ? For example, in http://coverage.livinglogic.de/Objects/funcobject.c.html, the count field, what it means? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python unit tests.

2009-04-15 Thread skip
how do I read the info at http://coverage.livinglogic.de ? For example, in http://coverage.livinglogic.de/Objects/funcobject.c.html, the count field, what it means? Most likely it's the number of times that line was executed. Strong support for that comes from the fact that the