pytest delayed assert / multiple failure plugin, iteration 1

In Delayed assert / multiple failures per test, I presented a first attempt at writing an ‘expect()’ function that will allow
a test function to collect multiple failures and not stop execution until the end of the test.

There’s one big thing about that method that I don’t like.
I don’t like having to call ‘assert_expectations()’ within the test.
It would be cool to push that part into a plugin.

So, even though this isn’t the prettiest code, here’s a first attempt at making this a plugin.

[Read more…]

Delayed assert / multiple failures per test

A test stops execution once it hits a failing assert statement.
That’s kinda the point of an assert statement, though, so that’s not surprising.

However, sometimes it’s useful to continue with the test even with a failing assert.

I’m going to present one method for getting around this restriction, to test multiple things, allow multiple failures per test, and continue execution after a failure.

I’m not really going to describe the code in detail, but I will give the full source so that you can take it and run with it.

[Read more…]

perspectives, opinions, dogma, and an elephant

I had assumed that everyone has heard the story about the blind men and the elephant.
However, in a very non-scientific poll of a hand full of fellow engineers at my day job, only about half had.

So I was going to try to quote it here, but when I looked up a reference for it, I came across a joke that amused the pants off me.

So here’s the joke:

Six blind elephants were discussing what men were like. After arguing they decided to find one and determine what it was like by direct experience. The first blind elephant felt the man and declared, ‘Men are flat.’ After the other blind elephants felt the man, they agreed.


“We have to remember that what we observe is not nature in itself, but nature exposed to our method of questioning.”- Werner Heisenberg

wikipedia entry

Well. I thought it was funny.

Trust me that this ties in with software development and testing.

[Read more…]

Book update: Python Testing with unittest, nose, pytest

This is a collection of posts that I felt would be really handy to have available all together.

Of course the introduction posts are in there too. But this is really a lot of information about quickly getting up to speed on unittest, nose, and pytest.

I’ve just updated it to fix some “glitches” in the initial eBook conversion process.

Python Testing with unittest, nose, pytest

What’s there:


[Read more…]