Testing FeedTools Dynamically
In the spirit of this, and based on this from the Universal Feed Parser, I created this for FeedTools, enabling FeedTools to directly make use of the vast suite of feedparser tests. These tests already pass.
It’s just data
In the spirit of this, and based on this from the Universal Feed Parser, I created this for FeedTools, enabling FeedTools to directly make use of the vast suite of feedparser tests. These tests already pass.
Slides from my OSCON presentation.
Spotted in the audience: Jim Hugunin, Patrick Michaud, Guido van Rossum, Chip Salzenberg, and Larry Wall.
Reminder: early registration ends Monday.
All tests successful.
What does this mean? Pretty much that these particular tests pass, nothing more, nothing less.
Some people like to do crossword puzzles, lately I've been amusing myself by getting some new feature of Python implemented on Parrot. Here are some recent successes:
In many ways, it seems like Python and Parrot are from different planets.
In Python, the general approach seems to be to reduce everything possible to a canonical form as early as possible, and then deal with everything consistently.
In Parrot, the general approach seems to be to leave everything in its original form as long as possible, and then deal with everything separately.
Pirate's
unittests were structured in the conventional way: one class
with a large number of test_* methods, each containing
a single test case. One of my first changes to Pirate was to
unbundle these into separate
files. I did this using a trick I picked up from
Mark Pilgrim, namely to create
a loop which dynamically created test_* methods, one per
file, thus:
# For every test/*/filename.py file, create a test_filename method
for test in sys.argv[1:] or glob("test/*/*.py"):
testName = "test_" + os.path.splitext(os.path.split(test)[1])[0]
testFunc = lambda self, test=test: self.runTest(test)
testFunc.__doc__ = testName
instanceMethod = new.instancemethod(testFunc, None, PirateTest)
setattr(PirateTest, testName, instanceMethod)
While exploring Python on Parrot, I was curious to see how Parrot handled Dealing with Diversity.
I'm putting
this out here so that people can poke fun at it. It is
totally
TDD, and
YAGNI.
In fact, the only portion that has had more than a few moments of
thought put into it is in the ast.__init__ source
file.
I'm totally impressed by Michal's Pirate, in a put everything in one source file as the author has the whole problem in his head sort of way.
What I would like to see is a refactoring so that blocks of code are objects which understand their own symbol tables. My goal is to implement patterns which reflect how a human coder would chose to implement something in Parrot.
Comparison of various Python implementations for conformance.
One of the name for Python running on Parrot is Pyrate. I'm trying to make sense of the current state of the effort.
A long, long time ago
I can still remember
How those weblogs used to make me smile...
Excellent. My favorite comment to date: RefactorOK
Update: The Blog Herald is offering $20 for the first Blogger or web surfer to submit a reasonably sung version. Shannon's in!