Quantcast
Channel: The Voidspace Techie Blog
Browsing all 22 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

mock 0.8 release candidate 1 and handling mutable arguments

I've released mock 0.8 release candidate 1. You can download it it or install it with: pip install -U mock==dev mock is a library for testing in Python. ... [613 words]

View Article



Image may be NSFW.
Clik here to view.

Sphinx doctests and the execution namespace

I've finally started work on the documentation for mock 0.8 release, and much of it involves converting the write-ups I did in the blog entries. The mock documentation is built with the excellent...

View Article

Image may be NSFW.
Clik here to view.

Python on Google Plus

As you may (or perhaps not) have noticed, I've been blogging a lot less in the last year. A new job with Canonical (although I've been there over a year now) and an eight month old daughter all make...

View Article

Image may be NSFW.
Clik here to view.

mock 0.8rc2: new release and development docs

I've pushed out a new release of mock. This fixes an inconsistency in the create_autospec api I discovered whilst working on the docs (yes I've really been working on the docs), and a fix for a bug...

View Article

Image may be NSFW.
Clik here to view.

Mocks with some attributes not present

Mock objects, from the mock library, create attributes on demand. This allows them to pretend to be objects of any type. ... [199 words]

View Article


Image may be NSFW.
Clik here to view.

Simple mocking of open as a context manager

Using open as a context manager is a great way to ensure your file handles are closed properly and is becoming common: with open('/some/path', 'w') as f: f.write('something') The issue is that even if...

View Article

Image may be NSFW.
Clik here to view.

Callable object with state using generators

It's often convenient to create callable objects that maintain some kind of state. In Python we can do this with objects that implement the __call__ method and store the state as instance attributes....

View Article

Image may be NSFW.
Clik here to view.

mock 0.8 released

After more than six months development work mock 0.8 has been released. 0.8 is a big release with many new features, general improvements and bugfixes. ... [968 words]

View Article


Image may be NSFW.
Clik here to view.

Tests that fail one day every four years

Some code looks harmless but has hidden bugs lurking in its nether regions. Code that handles dates is notorious for this, and this being February 29th (the coders' halloween) it's time for the bugs to...

View Article


Image may be NSFW.
Clik here to view.

Ergonomics: Kinesis Freestyle Keyboard and Evoluent Vertical Mouse

I've been using computers for a long time, and for most of that time I've been using them for the whole of the working day and often the rest of the day too. A few years ago I started getting pains in...

View Article

Image may be NSFW.
Clik here to view.

unittest.mock and mock 1.0 alpha 1

One of the results of the Python Language Summit at PyCon 2012 is that mock is now in the Python standard library. In Python 3.3 mock is available as unittest.mock. ... [501 words]

View Article

mock 0.8 release candidate 1 and handling mutable arguments

I've released mock 0.8 release candidate 1. You can download it it or install it with: pip install -U mock==dev mock is a library for testing in Python. ... [613 words]

View Article

Sphinx doctests and the execution namespace

I've finally started work on the documentation for mock 0.8 release, and much of it involves converting the write-ups I did in the blog entries. The mock documentation is built with the excellent...

View Article


Python on Google Plus

As you may (or perhaps not) have noticed, I've been blogging a lot less in the last year. A new job with Canonical (although I've been there over a year now) and an eight month old daughter all make...

View Article

mock 0.8rc2: new release and development docs

I've pushed out a new release of mock. This fixes an inconsistency in the create_autospec api I discovered whilst working on the docs (yes I've really been working on the docs), and a fix for a bug...

View Article


Mocks with some attributes not present

Mock objects, from the mock library, create attributes on demand. This allows them to pretend to be objects of any type. ... [199 words]

View Article

Simple mocking of open as a context manager

Using open as a context manager is a great way to ensure your file handles are closed properly and is becoming common: with open('/some/path', 'w') as f: f.write('something') The issue is that even if...

View Article


Callable object with state using generators

It's often convenient to create callable objects that maintain some kind of state. In Python we can do this with objects that implement the __call__ method and store the state as instance attributes....

View Article

mock 0.8 released

After more than six months development work mock 0.8 has been released. 0.8 is a big release with many new features, general improvements and bugfixes. ... [968 words]

View Article

Tests that fail one day every four years

Some code looks harmless but has hidden bugs lurking in its nether regions. Code that handles dates is notorious for this, and this being February 29th (the coders' halloween) it's time for the bugs to...

View Article
Browsing all 22 articles
Browse latest View live




Latest Images