the further adventures of

Mike Pirnat

a leaf on the wind

Next Page »

Failing Tests? FFFFFFFUUUUUUUUUUUU...

On Friday I ran across this modest proposal to make the output of Python's unittest2 more closely resemble the emotional state of the tester when there are a lot of failing unit tests. Once my coworkers were done asking if I was all right, or if they should be worried about the cackling and giggles coming from my cube, I resolved to make this dream a reality.

My workplace has settled on the nose testing framework. Like other frameworks, nose offers a plugin architecture to allow all kinds of additional customization and tweaks, and since I had never written one before, it seemed like this might be a good opportunity to give it a try. I found the plugin development docs to be a little too terse and not terribly n00b-friendly, but over the course of a couple of hours I was able to cobble something together. (I mostly ended up cheating off of Kumar McMillan's nose-nicedots, which got me over the hurdle of realizing I needed my own flavor of TestResult to make sure I got the usual stack trace output while still emitting the F's and U's correctly.)

It basically goes like this:

$ nosetests --with-f7u12

.......FFFFFFFFUUUUUUUUUUUUUUUU..U..U..U..U..U..U.
======================================================================
FAIL: test_f7u12.TestGeneratesLotsOfFailures.test_generates_failures(7,)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/mpirnat/Documents/code/python/nose-f7u12/lib/python2.7/site-packages/nose-1.1.2-py2.7.egg/nose/case.py",
line 197, in runTest
    self.test(*self.arg)
File
"/Users/mpirnat/Documents/code/python/nose-f7u12/src/examples/test_f7u12.py",
line 15, in _make_a_test
    assert False
AssertionError


< lots more test failure output; use your imagination... >


Ran 50 tests in 0.021s

FAILED (errors=30)

After some wrangling with PyPI (which could also be a lot friendlier to a packaging n00b--big thanks to Michael Foord for helping set me straight), it should be easy_install-able, or you can grab the source from Github (patches welcome!). And if you prefer pytest over nose, it looks like they've got a plugin too.

It's a tremendously silly thing, but it brought me some joy; I hope it can brighten your day too, or at least bring some comfort and commiseration to your test failure rage.

Read and Post Comments

Freeform Night at Clepy and the Ghost of Gary Bernhardt

April's Clepy meeting saw a much smaller than usual crowd, and a much more casual program--everyone who'd been lined up to give talks had had to bail at the last minute. So instead of covering anything formally, we spent a relaxing two hours enjoying beer, pizza, and various freeform, impromptu lightning talks. You couldn't even really call them lightning talks since we had no time limit, just an unspoken gentlemen's agreement to yield the projector cable when the time was appropriate.

Steve Dee showed off his CWRU senior project, jsPrettify, a bit of Javascript tomfoolery to automatically turn ASCII sequences into appropriate (and arguably prettier) Unicode equivalents. We also had a nice chat about the Closure Javascript tools that Steve had been introduced to while interning at Google. (Some aspects, like the provide/require system, remind me a lot of Dojo, and while it seems intriguing, reading some other opinions has me back in the skeptical category.)

Mike Crute showed us his not-yet-ready-to-release tool for automating provisioning and deployment of VPS nodes and the apps they serve, which seems like a really slick way to react to traffic needs (consolidate apps onto fewer boxes during low traffic periods, rearrange on the fly if someone's site is spiking). He also showed off something else that I mostly missed, so the Python code we glimpsed (featuring a lone "Oh, my..." comment to apologize for the 100-line method that was about to commence) didn't really mean a lot to me.

We had a brief glimpse of Mike's desktop wallpaper (a demotivational poster featuring a stern-looking John McCarthy) which inspired me to create this little gem (sorry in advance, Gary!):

image: Gary Bernhardt (as John McCarthy): 'Programming: You're Doing It Wrong'

Nick Barendt gave a quick introduction to Buildbot while I VPNed into work to prep my own demo of Das Blinkenlights, my little AIR app for monitoring the current build status of our various build slaves at work. The Python code to emit the JSON feed that Das Blinkenlights consumes hasn't yet been released to the public, but I have permission from the Powers That Be to do so, so I should get around to it before too long. (Beware my extremely unfinished and gross Javascript code in Blinkenlights--it's still in very rough shape at this point).

We had a new member tonight who was interested in applying Python for developing web apps, so we may try to pull together a "web framework shootout" for next month, which I envision as four or five different presenters simultaneously live coding the same basic web app (probably a wiki, blog, or to-do list) using different toolkits. We'll need to see about some cabling and KVMs, I think, so that we can rapidly switch back and forth between presenters. More details to follow, I'm sure...

If you're in Northeast Ohio and want to hang out with smart, friendly people who like Python, come on down! Meetings are held on the second Monday of the month aboard LeanDog's awesome boat, and we have an official pizza and beer fund going to supply us with tasty treats. It's a good time that I highly recommend.

Read and Post Comments

The Upside of Influenza

I spent the better part of a week in bed with a nasty case of influenza--chills, aches, sweats, nausea, digestive "issues", 102.9 degree fever--the works. And once again, everyone in my family had the great taste to all get sick at the exact same time, so you can imagine the fun that Liz and I had trying to comfort and care for Claire while we were clobbered by the bug.

But! Surprise, surprise! It turns out that even influenza can have a silver lining or two.

First, I lost six pounds, which is nice in the wake of holiday indulgence and a baby-driven complete lack of regular exercise routine.

More importantly, I now know what's happening to my sock drawer.

About once a week, I find my sock drawer in disarray, half-open and mixed-up, with two or three pairs on the floor in front of the dresser. I'd been wondering why and how for a while. Luckily, when one spends a week in bed with said dresser in direct view, one gets a chance to observe the cause and culprit first-hand--namely, Valentine the cat. She's figured out how to open the drawer, then jumps up onto the dresser and starts digging in the socks until she's satisfied with the disaster she's caused. I watched her steal four pairs of socks before she finally got bored and dashed off to chase her sister. I just about died laughing.

I know I sound like a broken record--but I'd really love to have a couple weeks or even a month of 2008 in which I'm not being devastated by the illness of the week.

Read and Post Comments

Early Adopter


IMG_2384.JPG
Originally uploaded by mikepirnat.

My mother-in-law dropped off this "calming vibrations" baby chair in anticipation of our eventual new arrival, but Julia seems to have already staked her own claim to it.

(And there are more cute cat photos if you need them.)

...

Oh, and my computer is still alive--turns out I'd blown a DIMM somehow. The nice Apple Store folks swapped in two fresh sticks and all's well again (and just in time for my speakers to dramatically short out at four AM this morning, but that's another story).

Read and Post Comments

Good, Bad, and a Little Funny

Good: Got first big chunk of big project delivered on time and more or less working as desired. Business folks are generally happy with what our team produced in the limited time available.

Bad: Had to miss the holiday party at German class in order to get there, so no Sekt and no beer for me.

Good: It's beginning to feel a lot like Christmas! We have the tree up and decorated, presents wrapped, and I cashed in some iTunes credit to pick up the new Twisted Sister Christmas CD (so deliciously, horribly addictive, it transcends awfulness, leapfrogs novelty, and lands, perhaps a bit teeteringly, just within the realm of totally kick-ass). Here's what I've basically been doing since then: \m/ >_< \m/

Bad: Thanks to global warming (or a giant cloud of liberal claptrap, take your pick), it sure doesn't look like Christmas... It's December in Cleveland; should we be having temperatures close to 60 degrees? I'm not the biggest fan of snow--especially when I have to deal with idiots who don't know how to drive in it--but do we really only get one week of winter this year?

Good: The Lost Room. Check it out in reruns or the inevitable DVD if you missed it.

Bad: The Lost Room left the door wide open (yes, a deliberately awful pun, deal with it) to become a full-fledged series. I'm not sure I have time to be obsessed over another long-form serial.

Good: New firmware for my router, maybe it'll solve my streaming audio throughput issues!

Bad: New router firmware makes streaming audio around the house even worse. My (admittedly venerable) SliMP3 now chokes after 9 seconds instead of 37. Bah, humbug!

Good: My tire was repairable, and still under warranty to boot, which means it was free! Yay!

Funny: I got a job offer from a headhunter today, very excited that I had Python experience. Turns out he's trying to place me into the company where I already work. (Woops!) After quite nearly LMAO, I shot back a polite rejection. I wonder what my boss would say if a headhunter slipped her my resumé...

Speaking of my resumé... where exactly should I list being named Time's Person of the Year?

Read and Post Comments

PyCon: Day 2.5

Having (finally) had some success with Twisted and Jabber, I am taking a moment to celebrate with a bottle of Harp. The NerdBooks.com party was pretty cool, though mellow. They have an insane selection of books -- everything from animation to signal processing. As it turns out, they have insanely great prices on things too, and I only now realized that books purchased on premises would ring up at their online prices rather than their cover prices. Argh!! On the plus side, they also seem to have surprisingly reasonable shipping rates too, so maybe I'll pick up a few things as early birthday presents for myself. They put out a nice spread of food, and the extremely hot pepperjack cheese has enabled me to breathe freely once again.

Beyond that, it's been a nice evening of chilling in the hotel lobby, taking advantage of the comfy chairs, interesting company, and the conference's free wireless. Met a nice chap from Slovenia; chatted with Kevin Dangoor for a bit; tinkered with code; shot the proverbial breeze with fellow Clevelanders David Stanek and Ian Maurer.

02-25-06_2148.jpg 02-25-06_2213.jpg

Overheard in the lobby: "Is it a convention of Laptop People or something?"

My most quotable utterance of the evening: "We need something like WSGI, but for management." (You kind of had to be there.)

Yep.... Good times. Definitely good times.

Read and Post Comments

Next Page »