Nice analysis of It's a poor workman that blames his tools.
Back to flipping out...
The Home for People Who Like to Flip Out and Write Code
Nice analysis of It's a poor workman that blames his tools.
Back to flipping out...
Posted by
Hank Gay
at
04:22
View Comments
Labels: sneak_attack
TIMESTAMP literal syntax
TIMESTAMP'2009-01-15 00:00:00.000'
Back to flipping out...
Posted by
Hank Gay
at
08:26
View Comments
Labels: note-to-self, Oracle
A nice overview of Advanced Message Queuing Protocol (AMQP) concepts, with Python examples using py-amqplib .
Back to flipping out...
Posted by
Hank Gay
at
07:38
View Comments
Labels: amqp, python, sneak_attack
decorator module
The decorator module is spiffy stuff.
Back to flipping out...
Posted by
Hank Gay
at
06:41
View Comments
Labels: python, sneak_attack
The next time you're doing some rough benchmarking and you want to prevent Oracle's cache from skewing your subsequent runs:
alter system flush buffer_cache;
Be forewarned: sometimes it takes a while to run this one, and you need system-level privileges.
Back to flipping out...
Posted by
Hank Gay
at
14:24
View Comments
Labels: benchmarking, note-to-self, Oracle
What follows is essentially a stream-of-consciousness dump from the PyAtl meeting tonight.
They're recruiting people to do A/V work during PyCon here in Atlanta next year. Does this mean I get in to the con for free?
Alfredo Deza presenting.
Talking about testing Supay (a daemon module; named after an Incan demon god). Why another daemon module?
Originally testing was done in Pythoscope. Easy to get started. Moved on to nose. Had problems because things under test were backgrounding, etc. People on the testing in Python mailing list advised him to test smaller chunks. coverage does testing coverage reporting for nose. coverage gives you really specific (package-specific, etc.) statistics.
The cool thing about nose is that it autodetects your tests.
One early gotcha: You have to invoke nose using nosetests. ed. I might as well alias `nosetests` to `nosetests -v --cover-package=$package_name`. Simply add --with-coverage to get the coverage report.
Cool, Pythoscope generates test stubs for you. I need me some of this.
There was some A/V stuff going on here, so they took this opportunity to hand out books for review. I scored Expert Python Programming.
Brandon Rhodes presenting.
At first, he thought testing would help most by helping to get it right at first. Once he started testing, he discovered that it helped most with finding regressions. Much like undo, now he can't imagine getting by without it. One thing to note: installed Python packages rarely ship with tests, so if you want to muck around in them, you typically need to download the tarball yourself.
Uses setuptools, so you can just use the built-in test command. You can use an additional_tests function to build a test suite for setuptools. setuptools will not autodetect doctest tests. All in all, this is a pretty well-behaved module.
Sidenote: virtualenv - creates local, tiny Python install that you can use to avoid system-wide changes. I've seen it mentioned before, but this is the first time I've seen it in action; this could be seriously cool.
Has a README.unittests (referenced from README) that tells you exactly how to do things. There is a lot of work to manually keep track of the tests in modules; obviously, this is begging for someone to forget to add a test to the suite.
The tests here are pretty idiosyncratic (each test defines a complete web app and puts it through its paces). It uses part of zc.testrunner.
Python testing frameworks:
Questions you should ask:
One benefit of testing frameworks is that it makes the testing in your project look like the testing in other projects that use the same testing framework.
zc.testrunner
Not really covered beyond what we saw with Grok.
py.test
Finds tests based on a naming convention; this is not configurable. Tests are just functions; you don't need a class w/ test methods. You can tag tests any way you want. By default only outputs print statements if it fails. Has distributed tests and multiplatform, but the documentation is a bit sparse. Uses a module to turn on autodetection for doctest tests.
nose
Finds tests based on a naming convention; this is configurable. Tests are just functions; you don't need a class w/ test methods. You can tag tests any way you want. Has more extensive documentation and seems to have momentum.
It is probably feasible to write your tests so both py.test and nose can find and run them.
Brandon Rhodes presenting.
Not a lot new to me; already used Selenium at work. The Python client seems to be doing a pretty good job of being Pythonic; the tests use unittest, etc. The basic commands seem pretty similar to the Java client I've used before.
Alfredo Deza presenting.
Brief compare/contrast between hg and svn. I'm already familiar with both so I won't recap this part of the presentation.
Traditionally, svn has been the standard for Google Code. They're giving invites to anyone attending the Google IO Conference (next week?). They're also accepting applications here; this is for old projects and they will move it over to keep the history. Not all features are available on the Mercurial version yet, e.g., code browsing.
Coolest feature: hg serve. It sets up a web interface to your entire repo on localhost:8000. It's pretty sophisticated, and allows you to push and pull from it.
And that concluded the evening.
Back to flipping out…
Posted by
Hank Gay
at
21:39
View Comments
Labels: python
The plain Subversion equivalent of git-revert.
Back to flipping out...
Posted by
Hank Gay
at
10:14
View Comments
Labels: sneak_attack, subversion