Real Ultimate Programming

The Home for People Who Like to Flip Out and Write Code

Notes From PyATL 2012-07-12

Announcements (Doug)

  • Julython
  • PyATL Ladies
  • A contractor with too much work; hook him up w/ Matt (

file.readline() (Doug)

  • I think this is about the hint param that came up on the core-mentorship mailing list.
  • It appears the way the hint works is that it has a base buffer size and it uses the hint to figure out a multiplier to use on the base: if the hint is big enough to fit in 1 * base, then it reads buf_size bytes, if it is too big for 1, but fits in 2, it reads 2 * buf_size bytes, etc. (btw, it reads that many bytes, and then reads to the next newline, to be particular)

Crash Course in PyTest (?)

  • What is it? A test runner (similar to nose?)
  • By default, PyTest runs functions that start with test_
  • Mostly relies on the built-in assert statement
  • You can use the pytest.raises context manager to test that some code throws an Exception
  • You can put your tests in the module with the rest of your stuff, pytest don’t give a…
  • Doctests? pytest don’t give…
  • “Sidecar” layout (test_X module next to module X)? pytest don’t… you get the picture
  • The “Quarantine” layout: a separate tests dir next to your project’s primary directory.
  • A pretty lengthy overview of mock right in the middle.
  • It’s got integration, which is nice.
  • What about nose? It was more convenient for him when he was first getting started.
  • It totally understands unittest-style tests.
  • (in response to a question from Rick) It runs in two passes (collection, test-running), and you probably don’t want to have side-effects in your imports.
  • It has some sort of profiling tools baked in, but not many details (pretty interesting, though).
  • (Another Q from Rick): What about unittest2? It’s more convenient for him.

Headless Browsing with Zombie (Ryan Petrello)

  • The goal is functional testing
  • Not many options for headless browsing in Python
  • He was inpsired by Zombie.js
  • Fun JavaScript bashing
  • I think I’d give this a look if I weren’t planning to look into PhantomJS (I ♥ WebKit)

A Short Introduction to PyGame (J. R. Rickerson)

  • Interested in games as technology drivers (both hardware and software).
  • PyGame wraps SimpleDirectMediaLayer
  • Games are event-driven, and the core of the game is the Event Loop
  • PyGame seems cool, overall. Way too much going on for me to do it justice.
  • Katie Cunningham is doing stuff w/ Rogue-likes; I wonder how this compares with the Caves of Clojure thing.