On 7/25/2016 12:45 PM, Joaquin Alzola wrote:
Hi Guys
I have a question related to unittest.
I suppose a SW that is going to live will not have any trace of
unittest module along their code.
In order to test idlelib, I had to a _utest=False (unittest = False)
parameter to some functions. The
Joaquin Alzola writes:
> I suppose a SW that is going to live will not have any trace of
> unittest module along their code.
Many packages are deployed with their unit test suite. The files don't
occupy much space, don't interfere with the running of the program, and
can be helpful to run the te
Generally, all your unittests will be inside a "tests" directory that lives
outside your package directory. That directory will be excluded when you
build or install your project using your setup.py script. Take a look at
some popular 3rd party python packages to see how they structure their
proj
On 03/11/2014 01:58 PM, Ethan Furman wrote:
So I finally got enough data and enough of an understanding to write some unit
tests for my code.
The weird behavior I'm getting:
- when a test fails, I get the E or F, but no summary at the end
(if the failure occurs in setUpClass before
On 3/12/2014 11:32 AM, Ethan Furman wrote:
I strongly suspect it's memory. When I originally wrote the code I
tried to include six months worth of EoM data, but had to back it down
to three as my process kept mysteriously dying at four or more months.
There must be waaay too much stuff bein
On 03/12/2014 04:38 PM, Steven D'Aprano wrote:
[snip lots of good advice for unit testing]
I was just removing the Personally Identifiable Information. Each test is pulling a payment from a batch of payments,
so the first couple asserts are simply making sure I have the payment I think I hav
On 03/12/2014 04:47 PM, Steven D'Aprano wrote:
top -Mm -d 0.5
Cool, thanks!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 12 Mar 2014 08:32:29 -0700, Ethan Furman wrote:
>> Some systems have an oom (Out Of Memory) process killer, which nukes
>> (semi-random) process when the system exhausts memory. Is it possible
>> this is happening? If so, you should see some log message in one of
>> your system logs.
>
On Tue, 11 Mar 2014 13:58:17 -0700, Ethan Furman wrote:
> class Test_wfbrp_20140225(TestCase):
>
> @classmethod
> def setUpClass(cls):
> cls.pp = wfbrp.PaymentProcessor(
> '.../lockbox_file',
> '.../aging_file',
> [
> Path
On Wed, 12 Mar 2014 08:32:29 -0700, Ethan Furman wrote:
> There must
> be waaay too much stuff being kept alive by the stack traces of the
> failed tests.
I believe that unittest does keep stack traces alive until the process
ends. I thought that there was a recent bug report for it, but th
In article ,
Ethan Furman wrote:
> > Alternatively, maybe something inside your process is just calling
> > sys.exit(), or even os._exit(). You'll see the exit() system call in
> > the strace output.
>
> My bare try/except would have caught that.
A bare except would catch sys.exit(), but not
On 03/12/2014 06:44 AM, Roy Smith wrote:
In article ,
Ethan Furman wrote:
I've tried it both ways, and both ways my process is being killed, presumably
by the O/S.
What evidence do you have the OS is killing the process?
I put a bare try/except around the call to unittest.main, with a pr
In article ,
Ethan Furman wrote:
> I've tried it both ways, and both ways my process is being killed, presumably
> by the O/S.
What evidence do you have the OS is killing the process?
Some systems have an oom (Out Of Memory) process killer, which nukes
(semi-random) process when the system e
On 03/11/2014 08:36 PM, Terry Reedy wrote:
On 3/11/2014 6:13 PM, John Gordon wrote:
In Ethan Furman
writes:
if missing:
raise ValueError('invoices %r missing from batch' % missing)
It's been a while since I wrote test cases, but I recall using the assert*
methods (
On 3/11/2014 6:13 PM, John Gordon wrote:
In Ethan Furman
writes:
if missing:
raise ValueError('invoices %r missing from batch' % missing)
It's been a while since I wrote test cases, but I recall using the assert*
methods (assertEqual, assertTrue, etc.) instead of ra
On 03/11/2014 03:13 PM, John Gordon wrote:
Ethan Furman writes:
if missing:
raise ValueError('invoices %r missing from batch' % missing)
It's been a while since I wrote test cases, but I recall using the assert*
methods (assertEqual, assertTrue, etc.) instead of raisin
On 03/11/2014 01:58 PM, Ethan Furman wrote:
Anybody have any ideas?
I suspect the O/S is killing the process. If I manually select the other class to run (which has all successful tests,
so no traceback baggage), it runs normally.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/pyth
In Ethan Furman
writes:
> if missing:
> raise ValueError('invoices %r missing from batch' % missing)
It's been a while since I wrote test cases, but I recall using the assert*
methods (assertEqual, assertTrue, etc.) instead of raising exceptions.
Perhaps that's the issue?
On 2013-06-29, Steven D'Aprano wrote:
> On Sat, 29 Jun 2013 19:13:47 +, Martin Schöön wrote:
>
>> $PYTHONPATH points at both the code and the test directories.
>>
>> When I run blablabla_test.py it fails to import blablabla.py
>
> What error message do you get?
>
>
>> I have messed around f
On Sat, 29 Jun 2013 19:13:47 +, Martin Schöön wrote:
> $PYTHONPATH points at both the code and the test directories.
>
> When I run blablabla_test.py it fails to import blablabla.py
What error message do you get?
> I have messed around for oven an hour and get nowhere. I have done
> unitt
In article ,
Martin Schöön wrote:
> I know the answer to this must be trivial but I am stuck...
>
> I am starting on a not too complex Python project. Right now the
> project file structure contains three subdirectories and two
> files with Python code:
>
> code
>blablabla.py
> test
>b
Sorry for breaking threading, but the original post has not come through
to me.
> On 18/10/2012 01:22, Rita wrote:
> Hi,
>
> Currently, I use a shell script to test how my system behaves before I
> deploy an application. For instance, I check if fileA, fileB, and fileC
> exist and if they do I go
On 10/17/2012 08:22 PM, Rita wrote:
> Hi,
>
> Currently, I use a shell script to test how my system behaves before I
> deploy an application. For instance, I check if fileA, fileB, and fileC
> exist and if they do I go and start up my application.
>
> This works great BUT
>
> I would like to use py
thanks.
I suppose I would need a simple example from one of these libraries. ( i
typed too soon for , "no code needed" )
On Wed, Oct 17, 2012 at 8:49 PM, Mark Lawrence wrote:
> On 18/10/2012 01:22, Rita wrote:
>
>> Hi,
>>
>> Currently, I use a shell script to test how my system behaves before
On 18/10/2012 01:22, Rita wrote:
Hi,
Currently, I use a shell script to test how my system behaves before I
deploy an application. For instance, I check if fileA, fileB, and fileC
exist and if they do I go and start up my application.
This works great BUT
I would like to use python and in part
On Saturday, September 1, 2012 12:19:10 AM UTC+8, Chris Withers wrote:
> On 23/08/2012 12:25, Tigerstyle wrote:
>
> > class FileTest(unittest.TestCase):
>
> >
>
> > def setUp(self):
>
> > self.origdir = os.getcwd()
>
> > self.dirname = tempfile.mkdtemp("testdir")
>
> >
On 23/08/2012 12:25, Tigerstyle wrote:
class FileTest(unittest.TestCase):
def setUp(self):
self.origdir = os.getcwd()
self.dirname = tempfile.mkdtemp("testdir")
os.chdir(self.dirname)
I wouldn't change directories like this, it's pretty fragile, just use
absolu
Ahh,
thank you very much Rob.
Fixed now.
Have a great day.
T
kl. 19:51:54 UTC+2 søndag 26. august 2012 skrev Rob Day følgende:
> On Sun, 2012-08-26 at 10:36 -0700, Tigerstyle wrote:
>
> > self.assertEqual(statinfo.st_size, filesize)
>
> >
>
> > I'm still getting AssertionEr
On Sun, 2012-08-26 at 10:36 -0700, Tigerstyle wrote:
> self.assertEqual(statinfo.st_size, filesize)
>
> I'm still getting AssertionError and the error says: 100 !=b'
>
>
filesize is the character 'b' repeated one million times (the contents
of the file, in other words). statinfo
Thanks Rob,
I'v modified the test_3 like this:
def test_3(self):
f = open("test.dat", "wb")
filesize = (b'b'*100)
f.write(filesize)
f.close()
statinfo = os.stat("test.dat")
self.assertEqual(statinfo.st_size, filesize)
I'm still getting
On Fri, 2012-08-24 at 09:20 -0700, Tigerstyle wrote:
> def test_3(self):
> f = open("test.dat", "wb")
> filesize = b"0"*100
> f.write(filesize)
> f.close()
> self.assertEqual(os.stat, filesize)
> The test_3 is to test if the created binary file har
Thank you guys, Roy and Terry.
I has been great help.
I still need some help. Here is the updated code:
Demostration of setUp and tearDown.
The tests do not actually test anything - this is a demo.
"""
import unittest
import tempfile
import shutil
import glob
import os
class FileTest(unittest.
On Thursday, August 23, 2012 1:29:19 PM UTC-4, Terry Reedy wrote:
> One can start with a set rather than tuple of file names.
> filenames = {"this.txt", "that.txt", "the_other.txt"}
Yeah, that's even cleaner. Just be aware, the set notation above is only
available in (IIRC), 2.7 or abo
On 8/23/2012 8:28 AM, Roy Smith wrote:
I think you want to end up with something like:
def test_1(self):
"Verify creation of files is possible"
filenames = ("this.txt", "that.txt", "the_other.txt")
for filename in filenames:
f = open(filename, "w")
In article <6b0299df-bc24-406b-8d69-489e990d8...@googlegroups.com>,
Tigerstyle wrote:
> Hi.
>
> I need help with an assignment and I hope you guys can guide me in the right
> direction.
> [code elided]
> 1. The test_1() method includes code to verify that the test directory
> contains only th
Kevin Zhang wrote:
> I want to sort the order of the unittest cases to be run, but found such
> statement in Python doc,
> "Note that the order in which the various test cases will be run is
> determined by sorting the test function names with respect to the built-in
> ordering for strings."
>
>
On Tuesday, August 21, 2012 5:34:33 AM UTC-4, Terry Reedy wrote:
> On 8/21/2012 5:09 AM, Kevin Zhang wrote:
>
> > Hi all,
>
> >
>
> > I want to sort the order of the unittest cases to be run, but found such
>
> > statement in Python doc,
>
> > "Note that the order in which the various test cas
On 8/21/2012 5:09 AM, Kevin Zhang wrote:
Hi all,
I want to sort the order of the unittest cases to be run, but found such
statement in Python doc,
"Note that the order in which the various test cases will be run is
determined by sorting the test function names with respect to the
built-in orderi
On 07/16/2012 02:37 PM, Philipp Hagemeister wrote:
> Can we improve the discoverability of the discover
> option, for example by making it the default action, or including a
> message "use discover to find test files automatically" if there are no
> arguments?
Oops, already implemented as of Python
On Mar 28, 6:55 pm, Ben Finney wrote:
> Steven D'Aprano writes:
> > (By the way, I have to question the design of an exception with error
> > codes. That seems pretty poor design to me. Normally the exception *type*
> > acts as equivalent to an error code.)
>
> Have a look at Python's built-in OS
Steven D'Aprano wrote:
To the degree that the decision of how finely to slice tests is a matter
of personal judgement and/or taste, I was wrong to say "that is not the
right way". I should have said "that is not how I would do that test".
I believe that a single test is too coarse, and three o
On Thu, 29 Mar 2012 08:35:16 -0700, Ethan Furman wrote:
> Steven D'Aprano wrote:
>> On Wed, 28 Mar 2012 14:28:08 +0200, Ulrich Eckhardt wrote:
>>
>>> Hi!
>>>
>>> I'm currently writing some tests for the error handling of some code.
>>> In this scenario, I must make sure that both the correct exce
On Thu, 29 Mar 2012 09:08:30 +0200, Ulrich Eckhardt wrote:
> Am 28.03.2012 20:07, schrieb Steven D'Aprano:
>> Secondly, that is not the right way to do this unit test. You are
>> testing two distinct things, so you should write it as two separate
>> tests:
> [..code..]
>> If foo does *not* raise a
Steven D'Aprano wrote:
On Wed, 28 Mar 2012 14:28:08 +0200, Ulrich Eckhardt wrote:
Hi!
I'm currently writing some tests for the error handling of some code. In
this scenario, I must make sure that both the correct exception is
raised and that the contained error code is correct:
try:
On 3/29/2012 3:28 AM, Ulrich Eckhardt wrote:
Equality comparison is by id. So this code will not do what you want.
>>> Exception('foo') == Exception('foo')
False
Yikes! That was unexpected and completely changes my idea. Any clue
whether this is intentional? Is identity the fallback when no
In article <0ved49-hie@satorlaser.homedns.org>,
Ulrich Eckhardt wrote:
> I didn't consciously use tabs, actually I would rather avoid them. That
> said, my posting looks correctly indented in my "sent" folder and also
> in the copy received from my newsserver. What could also have an
> in
Am 28.03.2012 20:26, schrieb Terry Reedy:
On 3/28/2012 8:28 AM, Ulrich Eckhardt wrote:
[...]
# call testee and verify results
try:
...call function here...
except exception_type as e:
if not exception is None:
self.assertEqual(e, exception)
Did you use tabs? They do not get preserved indefini
Am 28.03.2012 20:26, schrieb Terry Reedy:
On 3/28/2012 8:28 AM, Ulrich Eckhardt wrote:
with self.assertRaises(MyException(SOME_FOO_ERROR)):
foo()
I presume that if this worked the way you want, all attributes would
have to match. The message part of builtin exceptions is allowed to
change,
Ulrich Eckhardt wrote:
> True. Normally. I'd adapting to a legacy system though, similar to
> OSError, and that system simply emits error codes which the easiest way
> to handle is by wrapping them.
If you have
err = some_func()
if err:
raise MyException(err)
the effort to convert it to
e
Am 28.03.2012 20:07, schrieb Steven D'Aprano:
First off, that is not Python code. "catch Exception" gives a syntax
error.
Old C++ habits... :|
Secondly, that is not the right way to do this unit test. You are testing
two distinct things, so you should write it as two separate tests:
[..code
Ben Finney wrote:
> Steven D'Aprano writes:
>
>> (By the way, I have to question the design of an exception with error
>> codes. That seems pretty poor design to me. Normally the exception *type*
>> acts as equivalent to an error code.)
>
> Have a look at Python's built-in OSError. The various
On Thu, 29 Mar 2012 12:55:13 +1100, Ben Finney wrote:
> Steven D'Aprano writes:
>
>> (By the way, I have to question the design of an exception with error
>> codes. That seems pretty poor design to me. Normally the exception
>> *type* acts as equivalent to an error code.)
>
> Have a look at Pyt
Steven D'Aprano writes:
> (By the way, I have to question the design of an exception with error
> codes. That seems pretty poor design to me. Normally the exception *type*
> acts as equivalent to an error code.)
Have a look at Python's built-in OSError. The various errors from the
operating sy
On 3/28/2012 8:28 AM, Ulrich Eckhardt wrote:
Hi!
I'm currently writing some tests for the error handling of some code. In
this scenario, I must make sure that both the correct exception is
raised and that the contained error code is correct:
try:
foo()
self.fail('exception not raised')
catch M
On Wed, 28 Mar 2012 14:28:08 +0200, Ulrich Eckhardt wrote:
> Hi!
>
> I'm currently writing some tests for the error handling of some code. In
> this scenario, I must make sure that both the correct exception is
> raised and that the contained error code is correct:
>
>
>try:
>foo()
Let me have a guess :)
On 25/01/2012 7:42 PM, Ross Boylan wrote:
On Tue, 2012-01-24 at 13:54 -0800, Ross Boylan wrote:
...
The code I want to test uses threads, but that is not entirely internal
from the standpoint of the unit test framework. The unit test will be
executing in one thread, but
On Tue, 2012-01-24 at 13:54 -0800, Ross Boylan wrote:
> Is it safe to use unittest with threads?
>
> In particular, if a unit test fails in some thread other than the one
> that launched the test, will that information be captured properly?
>
> A search of the net shows a suggestion that all fail
On Tue, 24 Jan 2012 13:54:23 -0800, Ross Boylan wrote:
> Is it safe to use unittest with threads?
I see nobody else has answered, so I'll have a go.
I think you need to explain what you mean here in a little more detail.
If you mean, "I have a library that uses threads internally, and I want
t
Nose is absolutely the way to go for your testing needs. You can put
"__test__ = False" in modules or classes to stop test collection.
On Mon, Dec 12, 2011 at 5:44 AM, Thomas Bach wrote:
> Gelonida N writes:
>
>> Do I loose anything if using nose. or example can all unit tests / doc
>> tests st
Gelonida N writes:
> Do I loose anything if using nose. or example can all unit tests / doc
> tests still be run from nose?
AFAIK you don't loose anything by using nose – the unittests should all
be found and doctests can be run via `--with-doctest', I never used
doctests though.
regards
--
ht
On 12/12/2011 12:27 AM, Thomas Bach wrote:
> Gelonida N writes:
>
>> I'd like to use regular expresions as include / exclude rules
>> and I would like to have another filter function, which would check for
>> the existence of certain metavariabels in test suite files
>
> Did you have a look at n
Gelonida N writes:
> I'd like to use regular expresions as include / exclude rules
> and I would like to have another filter function, which would check for
> the existence of certain metavariabels in test suite files
Did you have a look at nose? I'm using it and it supports
include/exclude rule
In article ,
Tim Chase wrote:
> On 09/28/11 19:52, Roy Smith wrote:
> > In many cases, there's only two states of interest:
> >
> > 1) All tests pass
> >
> > 2) Anything else
>
> Whether for better or worse, at some places (such as a previous
> employer) the number (and accretion) of test-poin
On 09/28/11 19:52, Roy Smith wrote:
In many cases, there's only two states of interest:
1) All tests pass
2) Anything else
Whether for better or worse, at some places (such as a previous
employer) the number (and accretion) of test-points is a
marketing bullet-point for upgrades & new relea
In article <874nzw3wxc@benfinney.id.au>,
Ben Finney wrote:
> Roy Smith writes:
>
> > In article <87k48szqo1@benfinney.id.au>,
> > Ben Finney wrote:
> >
> > > Worse, if one of the scenarios causes the test to fail, the loop will
> > > end and you won't get the results for the remainin
Steven D'Aprano writes:
> I used to ask the same question, but then I decided that if I wanted
> each data point to get its own tick, I should bite the bullet and
> write an individual test for each.
Hence my advocating the ‘testscenarios’ library. Have you tried that?
It allows the best of bot
Roy Smith writes:
> In article <87k48szqo1@benfinney.id.au>,
> Ben Finney wrote:
>
> > Worse, if one of the scenarios causes the test to fail, the loop will
> > end and you won't get the results for the remaining scenarios.
>
> Which, depending on what you're doing, may or may not be import
On Wed, Sep 28, 2011 at 6:50 PM, Devin Jeanpierre
wrote:
>> I used to ask the same question, but then I decided that if I wanted each
>> data point to get its own tick, I should bite the bullet and write an
>> individual test for each.
>
> Nearly the entire re module test suite is a list of tuples
In article <87k48szqo1@benfinney.id.au>,
Ben Finney wrote:
> Worse, if one of the scenarios causes the test to fail, the loop will
> end and you won't get the results for the remaining scenarios.
Which, depending on what you're doing, may or may not be important. In
many cases, there's on
> I used to ask the same question, but then I decided that if I wanted each
> data point to get its own tick, I should bite the bullet and write an
> individual test for each.
Nearly the entire re module test suite is a list of tuples. If it was
instead a bunch of TestCase classes, there'd be a lo
In article <4e83b8e0$0$29972$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> If you are writing loops inside tests, you might find this anecdote useful:
>
> http://mail.python.org/pipermail/python-list/2011-April/1270640.html
On the other hand, the best test is one that gets writ
Tim Chase wrote:
> While I asked this on the Django list as it happened to be with
> some Django testing code, this might be a more generic Python
> question so I'll ask here too.
>
> When performing unittest tests, I have a number of methods of the
> form
>
>def test_foo(self):
> data
On 9/28/2011 10:16 AM, Tim Chase wrote:
When performing unittest tests, I have a number of methods of the form
def test_foo(self):
data = (
(item1, result1),
... #bunch of tests for fence-post errors
)
for test, result in data:
self.assertEqual(process(test), result)
When I run my tests, I onl
Ben Finney writes:
> You can use the third-party ‘testscenarios’ library
The URL got a bit mangled. The proper PyPI URL for that library is
http://pypi.python.org/pypi/testscenarios>.
> to generate test cases at run time, one for each combination of
> scenarios with test cases on the class. The
Tim Chase writes:
> def test_foo(self):
> data = (
> (item1, result1),
> ... #bunch of tests for fence-post errors
> )
> for test, result in data:
> self.assertEqual(process(test), result)
The sets of data for running the same test we might call “scenarios”.
>
On 10/26/2010 2:46 PM, AK wrote:
> Hi, I have a question about unittest: let's say I create a temp dir for
> my tests, then use loadTestsFromNames() to load my tests from packages
> and modules they're in, then use TextTestRunner.run() to run the tests,
> how can I pass information to TestCase inst
AK writes:
> Hi, I have a question about unittest: let's say I create a temp dir
> for my tests, then use loadTestsFromNames() to load my tests from
> packages and modules they're in, then use TextTestRunner.run() to run
> the tests, how can I pass information to TestCase instances, e.g. the
> lo
import unittest
class MyTestCase(unittest.TestCase):
def test_my_import(self):
import blah
cheers,
Chris
John Maclean wrote:
is there a way to test that a certian library or module is or can be
loaded successfully?
self.assert('import blah')
--
Simplistix - Content Management, Bat
There's no reason for such a thing.
You can just make "import module" in your test and if something goes
wrong that will be treated as any other test failure.
--- Giampaolo
http://code.google.com/p/pyftpdlib
http://code.google.com/p/psutil
2010/5/11 John Maclean :
> is there a way to test that a
On Mon, May 10, 2010 at 5:17 PM, cjw wrote:
> PyScripter and PythonWin permit the user to choose the equivalence of tabs
> and spaces. I like two spaces = on tab, it's a matter of taste. I feel
> that eight spaces is too much.
While it is a matter of taste, PEP 8 recommends 4 spaces per indent
On 10-May-10 10:21 AM, John Maclean wrote:
On 10/05/2010 14:38, J. Cliff Dyer wrote:
My guess is you mixed tabs and spaces. One tab is always treated by the
python interpreter as being equal to eight spaces, which is two
indentation levels in your code.
Though if it were exactly as you show it,
On 10/05/2010 14:38, J. Cliff Dyer wrote:
My guess is you mixed tabs and spaces. One tab is always treated by the
python interpreter as being equal to eight spaces, which is two
indentation levels in your code.
Though if it were exactly as you show it, you'd be getting a syntax
error, because e
My guess is you mixed tabs and spaces. One tab is always treated by the
python interpreter as being equal to eight spaces, which is two
indentation levels in your code.
Though if it were exactly as you show it, you'd be getting a syntax
error, because even there, it looks like the indentation of
On Mon, May 10, 2010 at 8:38 AM, John Maclean wrote:
> hi,
>
> can some one explain why the __first__ test is not being run?
It looks like you defined test_T1 inside of the tearDown method.
--
http://mail.python.org/mailman/listinfo/python-list
Oltmans wrote:
def test_first(self):
print 'first test'
process(123)
All test cases use the pattern "Assemble Activate Assert".
You are assembling a 123, and activating process(), but where is your assert? If
it is inside process() (if process is a test-side method), then
On Jan 14, 11:46 pm, exar...@twistedmatrix.com wrote:
> When you run test.py, it gets to the loadTestsFromName line. There, it
> imports the module named "test" in order to load tests from it. To
> import
> that module, it runs test.py again. By the time it finishes running the
> contents of t
On 06:33 pm, rolf.oltm...@gmail.com wrote:
Hi Python gurus,
I'm quite new to Python and have a problem. Following code resides in
a file named test.py
---
import unittest
class result(unittest.TestResult):
pass
class tee(unittest.TestCase):
def test_first(self):
print 'first te
Phlip wrote:
The reason the 'Tester' object has no attribute 'arg1' is because
"self" still refers to the object made for testA.
I hope someone else can spot the low-level reason...
...but why aren't you using http://pypi.python.org/pypi/mock/ ? Look
up its patch_object facility...
Indeed, I
André wrote:
> On Jan 5, 8:14 pm, Matt Haggard wrote:
>> Can anyone tell me why this test fails?
>>
>> http://pastebin.com/f20039b17
>>
>> This is a minimal example of a much more complex thing I'm trying to
>> do. I'm trying to hijack a function and inspect the args passed to it
>> by another f
On Jan 5, 8:14 pm, Matt Haggard wrote:
> Can anyone tell me why this test fails?
>
> http://pastebin.com/f20039b17
>
> This is a minimal example of a much more complex thing I'm trying to
> do. I'm trying to hijack a function and inspect the args passed to it
> by another function.
>
> The reason
On Jan 5, 4:14 pm, Matt Haggard wrote:
> Can anyone tell me why this test fails?
>
> http://pastebin.com/f20039b17
>
> This is a minimal example of a much more complex thing I'm trying to
> do. I'm trying to hijack a function and inspect the args passed to it
> by another function.
>
> The reason
Roy Smith wrote:
I'm running 2.5.1. I've got a test suite that takes about 15 minutes
to complete. On my unix boxes, as each test case executes, it prints
out a line (I'm using unittest.TextTestRunner(verbosity=2)) of status,
but on my windows box (running under cygwin), it buffers everything
u
On Tue, Nov 3, 2009 at 11:02 PM, Jonathan Haddad wrote:
> I've got a class, in the constructor it loads a CSV file from disc. I'd
> like only 1 instance of the class to be instantiated. However, when running
> multiple unit tests, multiple instances of the class are created. What's
> the best w
En Wed, 04 Nov 2009 01:02:24 -0300, Jonathan Haddad
escribió:
I've got a class, in the constructor it loads a CSV file from disc. I'd
like only 1 instance of the class to be instantiated. However, when
running
multiple unit tests, multiple instances of the class are created. What's
the
Gabriel Genellina wrote:
En Tue, 20 Oct 2009 19:57:19 -0300, Ethan Furman
escribió:
Steven D'Aprano wrote:
On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote:
My preference would be that failIfEqual checks both != and ==. This is
practical, and would benefit almost all use cases. If "!="
En Tue, 20 Oct 2009 19:57:19 -0300, Ethan Furman
escribió:
Steven D'Aprano wrote:
On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote:
My preference would be that failIfEqual checks both != and ==. This is
practical, and would benefit almost all use cases. If "!=" isn't "not
==" (IEEE NaNs
Steven D'Aprano wrote:
On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote:
My preference would be that failIfEqual checks both != and ==. This is
practical, and would benefit almost all use cases. If "!=" isn't "not
==" (IEEE NaNs I hear is the only known use case)
numpy uses == and != as
On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote:
> My preference would be that failIfEqual checks both != and ==. This is
> practical, and would benefit almost all use cases. If "!=" isn't "not
> ==" (IEEE NaNs I hear is the only known use case)
numpy uses == and != as element-wise operators:
> I was with you right up to the last six words.
>
> Whether it's worth changing assertNotEqual to be something other than an
> alias of failIfEqual is an interesting question. Currently all the
> assert* and fail* variants are aliases of each other, which is easy to
> learn. This would introduce a
On Tue, 20 Oct 2009 10:20:54 -0700, Zac Burns wrote:
> Using the assertNotEqual method of UnitTest (synonym for failIfEqual)
> only checks if first == second, but does not include not (first !=
> second)
>
> According to the docs:
> http://docs.python.org/reference/datamodel.html#specialnames The
1 - 100 of 245 matches
Mail list logo