Pyfit Madness Day 3
I’m glad to have pyfit, mostly because I’m glad to have something that works like fitnesse works. I’m not a huge fitnesse fan (it has some serious issues) but I’m a user.
However, the pyfit internals are pretty confusing to me. Today’s bit is really odd. There is a function in Variations. py called returnVariation() that takes a parameter called env. That argument is never used in the function and never passed to any other function it calls. Note that there is even a __pychecker__ trick there to turn off the syntax checker’s warning about unused parameters.
Generally the function is called and the return value is ignored. Clearly we’re dependent on side-effects here.
def returnVariation(env=None):
__pychecker__ = \"no-argsused\"
if FitGlobal.Environment == \"FitNesse\":
result = FitNesseVariation()
elif FitGlobal.Options.standardMode:
result = StandardVariation()
elif FitGlobal.Options.useCSS:
result = FitVariation()
else:
result = StandardVariation()
FitGlobal.annotationStyleVariation = result
return result
If you drop the argument, then tests stop passing.
def returnVariation():
Even though it’s never used and never passed. Even if you drop the parameter and set env to None:
def returnVariation():
env=None
__pychecker__ = \"no-argsused\"
if FitGlobal.Environment == \"FitNesse\":
result = FitNesseVariation()
elif FitGlobal.Options.standardMode:
result = StandardVariation()
elif FitGlobal.Options.useCSS:
result = FitVariation()
else:
result = StandardVariation()
FitGlobal.annotationStyleVariation = result
return result
There is one place where the function is called, passing a string value as env, otherwise it is always None, and it is still never passed to any method or installed in a global/local/module variable. But it somehow causes tests to fail if you remove it.

I didn’t like the pyfit internals and started from scratch.
I’ve got the basic working (chapter 3 fitbook examples)
Looking for help.
message outlining goals
Comment by Eddy Pronk — 2008-October-20 @ 02:26