Simon Willison’s Weblog

Subscribe

13 items tagged “unittests”

2022

How I build a feature

I’m maintaining a lot of different projects at the moment. I thought it would be useful to describe the process I use for adding a new feature to one of them, using the new sqlite-utils create-database command as an example.

[... 2779 words]

2020

How to cheat at unit tests with pytest and Black

I’ve been making a lot of progress on Datasette Cloud this week. As an application that provides private hosted Datasette instances (initially targeted at data journalists and newsrooms) the majority of the code I’ve written deals with permissions: allowing people to form teams, invite team members, promote and demote team administrators and suchlike.

[... 933 words]

2010

Unit Testing Achievements. A plugin for Python’s nose test runner that adds achievements—“Night Shift: Make a failing suite pass between 12am and 5am.” # 28th February 2010, 3:56 pm

rlisagor’s freshen. A Python clone of Ruby’s innovative Cucumber testing framework. Tests are defined as a set of plain-text scenarios, which are then executed by being matched against test functions decorated with regular expressions. Has anyone used this or Cucumber? I’m intrigued but unconvinced—are the plain text scenarios really a useful way of defining tests? # 5th January 2010, 7:30 pm

2009

Test-Driven Heresy. Tim Bray advocates TDD for maintenance development, but argues that it may not be as useful during the exploratory, greenfield development phase of a project. # 24th June 2009, 11:03 am

Right now, pypy compiled with JIT can run the whole CPython test suite without crashing, which means we’re done with obvious bugs and the only ones waiting for us are really horrible.

Maciej Fijalkowski # 1st May 2009, 3:04 pm

Django now has fast tests. Changeset 9756 switched Django’s TestCase class to running tests inside a transaction and rolling back at the end (instead of doing a full dump and reload). “Ellington’s test suite, which was taking around 1.5-2 hours to run on Postgres, has been reduced to 10 minutes.” # 16th January 2009, 11:40 am

2008

QUnit. The jQuery unit testing framework is now documented and supported as a separate project. # 26th May 2008, 5:31 pm

Django on Jython (via) Outstanding work from Jim Baker and the Jython team: Django now runs on the modern branch of Jython, with a couple of patches and some failed doctests due to dictionary order (a problem with Django’s test suite). # 4th January 2008, 12:35 pm

2007

Mock—Mocking and Test Utilities (via) New mocking library for Python based on the “action ... assertion” pattern (as opposed to the more common “record ... replay”). # 20th November 2007, 11:30 pm

Using the jQuery test suite for your own projects. jQuery’s test suite has clever start(), stop() and expect() methods for running assertions within asynchronous code. # 12th October 2007, 12:56 pm

Rails 1.2.1 Impression. I hadn’t seen assert_select before, which lets you unit test generated HTML using CSS selectors; a really neat idea. # 15th February 2007, 9:14 am

nose. Really nice Python unit testing tool—run ’nosetests somedir’ and it finds and executes every unittest (and test_like function) it can find in that directory tree. # 1st February 2007, 2:20 am