Is `0.0` the troublesome float here?
On Wed, Jul 19, 2017 at 7:35 AM, Shall, Sydney
wrote:
> I am learning to use unittest.
>
> I have written a program that runs as it should.
> 247 tests give me a satisfactory answer.
>
> I have now added one more test and I get an
I am learning to use unittest.
I have written a program that runs as it should.
247 tests give me a satisfactory answer.
I have now added one more test and I get an error which I do not understand.
The two relevant tests are:
def test_type_capitalsadvanced(self):
On 19 November 2015 at 13:25, Mike wrote:
> I'm trying to unit test a self-built regular expression processor for an
> assignment. I'm trying to set up unit tests for the package, but it's not
> executing them. This is my first time trying to use the unittest module, so
>
I'm trying to unit test a self-built regular expression processor for an
assignment. I'm trying to set up unit tests for the package, but it's not
executing them. This is my first time trying to use the unittest module, so
I'm sure I'm missing something, I'm just not sure what. I even put a test
Mike wrote:
> I'm trying to unit test a self-built regular expression processor for an
> assignment. I'm trying to set up unit tests for the package, but it's not
> executing them. This is my first time trying to use the unittest module,
> so I'm sure I'm missing something, I'm just not sure
On Thu, Nov 19, 2015 at 8:25 AM, Mike wrote:
> I'm trying to unit test a self-built regular expression processor for an
> assignment. I'm trying to set up unit tests for the package, but it's not
> executing them. This is my first time trying to use the unittest module, so
[ I've taken this discussion back to the tutor list. - Cameron ]
On 01Jun2015 18:14, Sydney Shall s.sh...@virginmedia.com wrote:
On 31/05/2015 03:00, Cameron Simpson wrote:
You say that your results are all rather close, consistent with the sigma
value I have chosen for the spread of my
On 31/05/2015 03:00, Cameron Simpson wrote:
On 30May2015 12:16, Sydney Shall s.sh...@virginmedia.com wrote:
Following advice from you generous people, I have chosen a project
that interests me, to develop some knowledge of python.
My projest is a simulation of a biological population.
I have a
On 02/06/2015 07:59, Steven D'Aprano wrote:
Please keep your replies on the tutor list, so that others may offer
advice, and learn from your questions.
Thanks,
Steve
On Mon, Jun 01, 2015 at 06:03:08PM +0100, Sydney Shall wrote:
On 31/05/2015 00:41, Steven D'Aprano wrote:
On Sat, May 30,
In a message of Sat, 30 May 2015 12:16:01 +0100, Sydney Shall writes:
MAC OSX 10.10.3
Enthought Python 2.7
I am an almost beginner.
Following advice from you generous people, I have chosen a project that
interests me, to develop some knowledge of python.
My projest is a simulation of a
On 30May2015 12:16, Sydney Shall s.sh...@virginmedia.com wrote:
Following advice from you generous people, I have chosen a project that
interests me, to develop some knowledge of python.
My projest is a simulation of a biological population.
I have a base class and a simulation function, which
On Sat, May 30, 2015 at 12:16:01PM +0100, Sydney Shall wrote:
I have written a unittest class which works OK.
But the problem I have is that because I use the random module to
populate my initial arrays, my data is not strictly predictable even
though I am using seed(0).
Please show us how
Sydney Shall wrote:
MAC OSX 10.10.3
Enthought Python 2.7
I am an almost beginner.
Following advice from you generous people, I have chosen a project that
interests me, to develop some knowledge of python.
My projest is a simulation of a biological population.
I have a base class and a
MAC OSX 10.10.3
Enthought Python 2.7
I am an almost beginner.
Following advice from you generous people, I have chosen a project that
interests me, to develop some knowledge of python.
My projest is a simulation of a biological population.
I have a base class and a simulation function, which
On 18/02/2015 20:40, Ben Finney wrote:
Sydney Shall s.sh...@virginmedia.com writes:
My test code is the following:
def test_func_getSurplusLabourTime_Exc(self):
self.assertRaises(ValueError,self.cwp.getSurplusLabourTime(self.cwp.ww,self.cwp.uvc))
[This last line should indented, but it
I use a MAC OSX 10.9.5
Enthought Canopy Python 2.7.6
I am a learner.
I am now trying to learn unittests as is often emphasised on this list.
I think that I have understood the simple unit tests such as Equal,
Greater etc.
But I am struggling with the syntax of a test for Raises an exception.
Hi,
When using self.assertRaises like this you should pass a callable (the
function you are going to call), but not call the function on the test. The
problem is when the function takes arguments. At this point you need to
create a callable with the two arguments. That can be done with functools
Sydney Shall s.sh...@virginmedia.com writes:
My test code is the following:
def test_func_getSurplusLabourTime_Exc(self):
self.assertRaises(ValueError,self.cwp.getSurplusLabourTime(self.cwp.ww,self.cwp.uvc))
[This last line should indented, but it refuses to do so!]
What is “it” which
From: Peter Otten __pete...@web.de
To: tutor@python.org
Sent: Thursday, April 3, 2014 3:13 PM
Subject: Re: [Tutor] unittest decorators
Albert-Jan Roskam wrote:
The unittest module has some really handy decorators: @unittest.skip
and @unittest.skipIf. I
Albert-Jan Roskam wrote:
The unittest module has some really handy decorators: @unittest.skip
and @unittest.skipIf. I use the former for temporary TODO or FIXME things,
but I use the latter for a more permanent thing:
@unittest.skipif(sys.version_info()[0] 2). Yet, in the test summary you
Hi,
The unittest module has some really handy decorators: @unittest.skip
and @unittest.skipIf. I use the former for temporary TODO or FIXME things, but
I use the latter for a more permanent thing:
@unittest.skipif(sys.version_info()[0] 2). Yet, in the test summary you just
see error,
On 01/08/13 13:11, Matthew Ngaha wrote:
im trying to do some unittesting and i've written 1 class with 4 test
methods and it skips 2 of these methods for no reason. If i comment
out the 2 it doesn't skip, it will now test the 2 it previously
skipped. Is this the default behaviour
I'm pretty
Hi,
On 1 August 2013 13:11, Matthew Ngaha chigga...@gmail.com wrote:
im trying to do some unittesting and i've written 1 class with 4 test
methods and it skips 2 of these methods for no reason. If i comment
out the 2 it doesn't skip, it will now test the 2 it previously
skipped. Is this the
Hi,
On 1 August 2013 14:22, Matthew Ngaha chigga...@gmail.com wrote:
Thanks guys. i was following some examples and noticed it. I tried to
use it in my program and the same thing happened. In this example,
there are 6 tests, and only 4 run.
http://bpaste.net/show/abLNTHU49w1j2M8Fey8X/
The
On 01/08/13 14:22, Matthew Ngaha wrote:
Thanks guys. i was following some examples and noticed it. I tried to
use it in my program and the same thing happened. In this example,
there are 6 tests, and only 4 run.
http://bpaste.net/show/abLNTHU49w1j2M8Fey8X/
You're still just teasing us.
You
Wayne Werner waynejwer...@gmail.com wrote
I'm trying my hand at test driven development via the unittest
module. Since
my program is using Tkinter, my thought is that I need to create the
main
window. The only problem is that when I launch the main loop,
further lines
of code aren't
I'm sure there's an incredibly simple way to do this, but at the moment it
eludes me.
I'm trying my hand at test driven development via the unittest module. Since
my program is using Tkinter, my thought is that I need to create the main
window. The only problem is that when I launch the main
List,
When using the unittest module, tests are run in alphanumeric order.
What's the suggested way of specifying a test order? Any code examples
would be great!
Thanks
-Modulok-
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
On Tue, 28 Sep 2010 04:03:17 am Modulok wrote:
List,
When using the unittest module, tests are run in alphanumeric order.
What's the suggested way of specifying a test order?
There isn't one. It shouldn't matter what order the tests run, no test
should *rely* on another test.
(Although of
List,
When using the unittest module, tests are run in alphanumeric order.
What's the suggested way of specifying a test order?
There isn't one. It shouldn't matter what order the tests run, no test
should *rely* on another test.
(Although of course, if one test fails, any tests
On 9/27/10, Steven D'Aprano st...@pearwood.info wrote:
On Tue, 28 Sep 2010 04:03:17 am Modulok wrote:
List,
When using the unittest module, tests are run in alphanumeric order.
What's the suggested way of specifying a test order?
There isn't one. It shouldn't matter what order the tests
On 27-Sep-10 15:07, Modulok wrote:
In an ideal world, I agree. This is possible for pure functional
programming where state is avoided. However, when dealing with object
oriented, imperative programming, state changes cannot be avoided.
Generally, a unit test should test a single aspect of a
On Tue, 28 Sep 2010 08:07:30 am Modulok wrote:
On 9/27/10, Steven D'Aprano st...@pearwood.info wrote:
On Tue, 28 Sep 2010 04:03:17 am Modulok wrote:
List,
When using the unittest module, tests are run in alphanumeric
order. What's the suggested way of specifying a test order?
There
On Thu, 4 Mar 2010 05:32:22 pm you wrote:
Steven D'Aprano wrote:
On Thu, 4 Mar 2010 04:27:23 am C.T. Matsumoto wrote:
Hello,
Can someone tell me the difference between unittests assertEqual
and assertEquals?
assertEqual, assertEquals and failUnless are three spellings for
the same
Hello,
Can someone tell me the difference between unittests assertEqual and
assertEquals?
Cheers,
T
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Thu, 4 Mar 2010 04:27:23 am C.T. Matsumoto wrote:
Hello,
Can someone tell me the difference between unittests assertEqual and
assertEquals?
assertEqual, assertEquals and failUnless are three spellings for the
same thing. There is no difference.
--
Steven D'Aprano
And in case:
# coding: utf-8
import traceback
try:
raise Exception(u'Зрегиться')
except Exception,e:
print traceback.format_exc().decode('utf-8').encode('cp437', 'replace')
Getting
beryl:~ oleg$ python ./wish/newaccount/reg.py
Traceback (most recent call last):
File
OK, your console is set to 'ascii' ('cp437' was my example and is the
Windows console encoding). 'ascii' won't be able to display Russian.
It shouldn't have displayed the Ð˜Ð·Ð²ÐµÐ½Ð¸Ñ characters either.
Are you still running on the same terminal that display those
characters? Can you change
Ok, seems it's my console setting. Tried console with koi8-r (from
http://vak.ru/doku.php/macosx-russian), and it looks ok there. Mean the
satndard output, but still getting D chars instead of russian when trying
to convert it to html via HTMLTestRunner (see
You get the D characters when decoding Russian encoded in UTF-8 using Latin-1
instead.
# coding: utf-8
x=u'Зарегистрироваться'
print x.encode('utf-8').decode('latin-1')
ÐаÑегиÑÑÑиÑоваÑÑÑÑ
Check that your html encoding is declared correctly.
--
Mark
Oleg Oltar [EMAIL
beryl:~ oleg$ env
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man
TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
TMPDIR=/var/folders/PC/PCtFE4gQGiqpQymiAScfnk+++TM/-Tmp-/
Apple_PubSub_Socket_Render=/tmp/launch-UNXiC6/Render
TERM_PROGRAM_VERSION=237
USER=oleg
And also:
Getting this in console when trying to generate report via HTMLTestRunner
(it displayed text correctly when tried simple unittest.main)
td colspan='5' align='center'a href=javascript:showOutput('pt1.1',
'test_create_account_to_check: Creating sample account for next
test')pass/a
script
Is that possible to run test cases independently (without unittest.main) and
how to do it
E.g. I tried it this way:
import random
import unittest
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
self.seq = range(10)
def testshuffle(self):
# make sure
On Wed, Jul 16, 2008 at 2:58 AM, Oleg Oltar [EMAIL PROTECTED] wrote:
Is that possible to run test cases independently (without unittest.main) and
how to do it
E.g. I tried it this way:
import random
import unittest
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
Hi I am using unittest framework with selenium.
When I tried this code (my verification point)
self.assertEqual(True, sel.is_text_present(uИзвените пароли не
совпадают), System didn't give a correct warning about the password
misstype)
Where uИзвените пароли не совпадают is russian =
On Wed, Jul 16, 2008 at 2:40 PM, Oleg Oltar [EMAIL PROTECTED] wrote:
Hi I am using unittest framework with selenium.
When I tried this code (my verification point)
self.assertEqual(True, sel.is_text_present(uИзвените пароли не
совпадают), System didn't give a correct warning about
Another possibility - do you have a coding declaration in your source
file, something like
# -*- coding: encoding name -*-
If so, does the coding declaration match the actual encoding of the file?
Kent
On Wed, Jul 16, 2008 at 5:11 PM, Kent Johnson [EMAIL PROTECTED] wrote:
On Wed, Jul 16, 2008
Seems need help there. Start getting
Traceback (most recent call last):
File ./newaccount/Same_domain_name.py, line 56, in
test_create_account_to_check
print sel.get_text(check_username_block)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-4:
ordinal not in
In [1]: import sys
In [2]: sys.getdefaultencoding()
Out[2]: 'ascii'
In [3]: sys.stdout.encoding
Out[3]: 'US-ASCII'
On Thu, Jul 17, 2008 at 6:29 AM, Oleg Oltar [EMAIL PROTECTED] wrote:
Seems need help there. Start getting
Traceback (most recent call last):
File
The code
# -*- coding: utf-8 -*-
#!/usr/bin/python
This test case check how system works in the situation, when user tries to
use already
used username (domain)
We are creating two accounts with such parameters:
1. Sex = Femle
2. Name1=Name2 = foobar%S
3. Pass1 = Name
4. Pass2 = Name
5.
The Exception is output in the encoding of the source file. If the terminal
you are displaying the exception on is in a different encoding, it will be
garbled. I'm not familiar with OS X's terminal. Try running python and
printing sys.stdout.encoding.
Alternatively, wrap your code in a
Hi!
I am trying to use unittest in python first time. But have a strange
traceback each time I run my sample tests.
Can you please explain why I have it. No info about it in the doc.
e.g. the code is
import unittest
import squaren
class TestCases(unittest.TestCase):
def setUp(self):
Oleg Oltar wrote:
Hi!
I am trying to use unittest in python first time. But have a strange
traceback each time I run my sample tests.
How are you running the test? My guess is that you are running it in an
IDE or something that shows the normal system exit exception.
Calling sys.exit()
Greetings:
I'm not certain this is the right forum for this question. If not, please
point me to the correct one.
I am using the unittest module to test a package our team is writing. I
presently have three modules of test cases and a top level module to run the
entire suite. The
Carroll, Barry wrote:
Greetings:
I'm not certain this is the right forum for this question. If not,
please point me to the correct one.
I am using the unittest module to test a package our team is writing.
I presently have three modules of test cases and a top level module to
run the
-1107
We who cut mere stones must always be envisioning cathedrals.
-Quarry worker's creed
-Original Message-
Date: Fri, 07 Apr 2006 15:42:15 -0400
From: Kent Johnson [EMAIL PROTECTED]
Subject: Re: [Tutor] Unittest not running all test cases
Cc: tutor
Kent:
-Original Message-
From: Kent Johnson [mailto:[EMAIL PROTECTED]
Sent: Friday, April 07, 2006 3:59 PM
To: Carroll, Barry
Subject: Re: [Tutor] Unittest not running all test cases
Carroll, Barry wrote:
Kent:
I just rechecked my class names, and there are no duplicates. I
I'm really enjoying Python. I don't like the sentence structure quite
as much as Smalltalk (ie I like anObject actOn: a untilYouSee: b),
Have you looked at Objective C?
It uses Smalltalk style messaging, but in a C language framework.
I find it much faster to do things in Python even over
lemeia wrote:
kent wrote:
Rereading your mail another possibility comes to mind. It sounds like
extractTo() is a general-purpose function that is used for a specific
purpose by the module you are testing. Why not extract extractTo to a
utility module? Then you can test it as much as you like
I currently have a class where I have quite a few private methods. One of these
methods is a small general utility that extracts characters from provided text
up until it reaches a delimiter. Something like extractTo(self, text,
delimiter).
It's not a relevant interface to the class, just a
lemeia wrote:
I currently have a class where I have quite a few private methods.
One
of these methods is a small general utility that extracts characters
from provided text up until it reaches a delimiter. Something like
extractTo(self, text, delimiter).
It's not a relevant interface to the
kent wrote:
I currently have a class where I have quite a few private methods.
One
of these methods is a small general utility that extracts characters
from provided text up until it reaches a delimiter. Something like
extractTo(self, text, delimiter).
It's not a relevant interface to
62 matches
Mail list logo