Archived discussion from PythonFit?.


FIT: " and > is not escaped. --"Eung-ju Park" , Tue, 15 Oct 2002 17:42:23 +0900 reply
Hi. I tried fit for python b021014. I found small bug. < is escaped at test resport, but " and > is not escaped.


Re: FIT: " and > is not escaped. --Simon Michael , Mon, 21 Oct 2002 10:03:08 -0700 reply
"Eung-ju Park" writes:

Hi. I tried fit for python b021014. I found small bug. < is escaped at test resport, but " and > is not escaped.

Thank you Eung-ju. There isn't yet a maintenance process for python fit, but I've saved this report for when there is.

Best regards, -Simon

Python FIT port --"John Roth", Fri, 22 Nov 2002 19:37:36 -0500 reply
I just downloaded the Python port of FIT, and ran the examples under Python 2.2.2. I suspect from the number of responses I got pointing to your port, you already know about most of this, but here it is anyway, just in case.

  1. It ran. The basic package ran without any tweaking. That's great! If I can figure it out, it looks like it's going to be very good.
  2. The arithmetic example ran with only one exception instead of the five in your sample output. This was due to the unification of ints and longs in Python 2.2. The division by zero exception still remains.

For some undetermined reason, the two multiplications that gave long results (the last two lines in the table) compared unequal with exactly the same results printed.

The problem on line 2 is due to the way division of integers works in Python before 2.3 (going into alpha shortly).

The errors in the second table are all either input, or floating precision.

The calculator example was zero length in the Results folder in the distribution. However, the example ran, and the results look like what I would expect, given several input errors, a couple of divide by zeros and some difficulty with floating comparisons.

The music example failed totally - all of the operations that needed some kind of introspection threw an exception "type object type has no attribute im_func"

I presume this is because of the changes between 2.1 and 2.2 due to type/class unification.

I can't say I understand all the issues in your Readme.txt file, and I don't have any real preferences at this point as to how to resolve them.

What I'm doing in my own work is providing a .getMetaData() method in any objects where tools need types. I doubt if this would be a very popular approach.

Anyway, it's a very nice beta, and I expect it will be quite useful.

Sincerely, John Roth

Python version of FIT. --"John Roth" , Sun, 24 Nov 2002 12:54:31 -0500 reply
As I said in my last message, I installed and played around a while. Most of the problems were due to two things:

  1. The extra level of table in the Calculator and Music examples. I simply hacked it out for now. That allowed the first table to process, which it wasn't before.


  1. A totally hosed method method in the ActionFixture? class. The following code fixes the method (total replacement.)

    def method(self,args): #methods = filter(callable, # map(lambda x:getattr(,x), # dir( test = self.camel(self.cells.more.text()) classDef = getattr(, "__class__", None) methodObj = getattr(classDef, test, None) if (type(methodObj) == type(self.method) and methodObj.im_func.func_code.co_argcount == 1+args): return methodObj raise NoSuchMethodException?

The problem arises because Python and Java have completely different introspection mechanisms. The approach I took is that Python simply doesn't have multi-methods, so searching for the correct method is heading off into the wrong direction. Either the method exists, or it doesn't, and either it has the right number of parameters, or it doesn't.

That got the Music example working. Now there seems to be an error in the RowFixture? because the last line of the two last tables are not being found, even though they are there in the other table.

Nice port - I'm looking forward to using it.

John Roth

Re: Python FIT port --"John Roth" , Tue, 26 Nov 2002 08:24:21 -0500 reply

----- Original Message ----- From: "Simon Michael" To: "John Roth" Sent: Monday, November 25, 2002 9:28 PM Subject: Re: Python FIT port

Hi John, thanks very much for your feedback and python 2.2 fixes. I have no maintenance process in place for this yet but have saved your messages for later.
Python 2.2.2. I suspect from the number of responses I got pointing to your port, you already know about most of this, but here it is anyway,

As a matter of interest, where was this ? Has a fit mailing list started ?

No, it was either the refactoring or the testdrivendevelopment yahoo list. Someone posted a pointer to FIT, and I didn't find the Python port, and mentioned I'd like to see one. I got about six to eight pointers to it!

Most of the problems were caused by my not figuring out that I needed to use the WikiRunner? module on two of the test cases, however, the Python 2.2 issue, especially with new classes, seems to be endemic. I needed to make the same change to ColumnFixture? as soon as I changed my fixture to a new type class. On the other hand, properties work fine so far. No changes needed to support them for setters, but I'm at a loss about how to support them for getters.

John Roth

Best regards, -Simon

From AlChou? From: Al Chou Subject: FIT b021014py ColumnFixture? To: Simon Michael Date: Wed, 29 Jan 2003 19:27:51 -0800 (PST) X-Spam-Status: No, hits=0.8 required=9.0 tests=SPAM_PHRASE_02_03 version=2.43

Hi, Simon,

Using your Python port of FIT, I noticed a bug related to empty cells in a ColumnFixture? table: if a previous row set a non-empty value for some column and the current row does not (the table cell is empty), then the current row will use the value previously set rather than setting the value to be empty. After a little digging I found a 2-line fix for ColumnFixture?. I don't know whether it applies to other fixtures despite a quick look at the standard FIT fixtures, but here it is anyway:

def doCell(self, cell, column): a = self.columnBindings[column]? try: if not a: self.ignore(cell) elif a.field: text = cell.text() if text: a.set(a.parse(text)) else : # These two lines a.set( '' ) # are new. elif a.method: self.check(cell, a) except Exception, e: self.exception(cell, e)

Thanks for your work on the port!


===== Albert Davidson Chou

Re: FIT b021014py ColumnFixture? --Simon Michael , Thu, 30 Jan 2003 06:27:38 -0800 reply
Thanks for this Al, I'll investigate for next release.

Best regards, -Simon

?FIT for Python --Kelley Harris , Thu, 20 Mar 2003 17:50:43 -0800 reply
Hello Simon -- Thank you for doing the python port of FIT. I look forward to using it. I'd appreciate some help getting started. If there is document with examples, I'd sure appreciate a link to to it. I was not able to understand the Usage section of the readme.txt file. Please see the error I get below

readme.txt Usage: add this directory to your PYTHONPATH and, eg,

python fit/FileRunner?.py Documents/arithmetic.html Reports/arithmetic.html

e:\programs\fitpython\release>python fit\FileRunner?.py Documents/arithmetic.html Reports/arithmentic .html

Traceback (most recent call last):

  File "Fit\", line 9, in ?
    from fit.Parse import Parse
 ImportError: No module named fit.Parse

fit\ is definately there in the release\fit directory

my PYTHONPATH: E:\programs\python2.2.2\lib;E:\programs\python2.2.2\lib\tkinter;E:\programs\ fitPython\Release;E:\programs\fitPython\Release\Fit;E:\programs\fitPython\Re lease\eg

Any hints would appreciated. I link to a document would help.

Thank you for doing the port. I look forward to using it.


Re: ?FIT for Python --Simon Michael , Sun, 23 Mar 2003 12:28:55 -0800 reply
Kelley Harris writes:


Hi Kelley.. I'd guess it's case problems, with the fit directory (call it "fit" everywhere) and/or ("").

Regards, -Simon

python fit update --Simon Michael, Tue, 29 Apr 2003 12:23:56 -0700 reply
Hi all,

inspired by the traffic on the list, I did some cleanup of the python fit source and gave it a temporary cvs home on sourceforge (see

In order to catch up with the java implementation, I've started this: download and unpack all java releases; for each release, do a recursive diff with the previous; apply each change to the python source as seems appropriate. Having java fit in cvs would help, but it's a chunk of work no matter what - if you'd like to help, send me your sourceforge id and I'll be delighted to give you commit access.

I tried simplifying the directory structure to be most familiar to installers and developers. I moved "eg" to "fit/fixtures". Note although this package checks out as fit and should be installed under that name, the cvs module is fit-python so it could coexist in a multi-platform fit repository. See what you think.

Here's one change which I made for safely invoking fit from my wiki clone (Zwiki):

This also helps Zwiki recognize fit tables, since non-fit tables are pretty common and I want fit support "always on" in Zwiki pages. (NB the FitNesse?, the playground, and Ward's fat page are looking great).

Cheers, -Simon

Fwd: BetaTrouble? --Ward Cunningham, Sun, 4 May 2003 16:02:50 -0700 reply
Simon -- Any advice for Anthony? Thanks. -- Ward

Begin forwarded message:

 > From: "Anthony Adachi" 
 > Date: Sun May 4, 2003  12:27:17  PM US/Pacific
 > To: Ward Cunningham
 > Subject: BetaTrouble
 > Ward
 > I've encountered a few issues when running the fitts framework (Python
 > version).
 > Example test observations:
 > *Results don't match Wiki's (
 >      a) Unexpected errors. (EOF and traceback).
 >      b) The results from some of the sample tests did not correspond to
 > what
 > happens when runs the ones on the Wiki.
 > *Also, I had Netscape 7.0.2 open while running the tests and for some
 > reason it was quit whenever the example tests were run.
 >      The following errors were in results.html file from Calculator test:
 >      "Traceback (most recent call last):
 >   File "Contraptions:Program Development:Python",
 > line
 > 30, in doTables
 >     exec 'import '+path
 >   File "", line 1
 >     import
 >           ^
 > SyntaxError: unexpected EOF while parsing
 > "
 > "Traceback (most recent call last):
 >   File "Contraptions:Program Development:Python",
 > line
 > 158, in check
 >     result = a.get()
 >   File "Contraptions:Program Development:Python
 > line 79, in get
 >     elif self.method: return self.invoke()
 >   File "Contraptions:Program Development:Python
 > line 89, in invoke
 >     return self.method(
 >   File "Contraptions:Program Development:Python
 >", line 74, in x
 >     self.hp.key(self.key)
 >   File "Contraptions:Program Development:Python
 >", line 23, in key
 >     elif key=="/":       t=self.pop(); self.push(self.pop()/t)
 > ZeroDivisionError: float division
 > "
 > Also, I've included the test results html files from three example tests
 > (arithmetic, CalculatorExample, & MusicExample).
 >      <Enclosure: results.html>
 >      <Enclosure: results.html>
 >      <Enclosure: results.html>
 > Thanks,
 > Anthony Adachi

Fwd: BetaRunning? --Ward Cunningham, Sun, 4 May 2003 16:08:06 -0700 reply

(I do have to work on that introductory documentation.)

Begin forwarded message:

 > From: "Anthony Adachi"
 > Date: Sun May 4, 2003  2:15:56  PM US/Pacific
 > To: Ward Cunningham
 > Subject: BetaRunning
 > Ward
 >>  Write us again when you run your first test.
 > I ran the example tests and this is in response to this request on the
 > fit's Wiki (
 >>  We'd like to know what was easy and what wasn't.
 > What's easy to like is the idea of automated acceptance tests. I found
 > Fit
 > was easy to download but not easy to get into in practice.
 > The Command line interface wasn't easy. Especially figuring out the
 > arguments required in order to execute the example tests. In fact, I
 > couldn't figure out how to get it working via the command line.
 > While, running on it's own, did produce this output stating
 > the required command input...
 > 'usage: python input-file output-file
 > Script exited with status code: -1'.
 > ...I tried to the best of my abilities to interpret those instructions to
 > no avail.
 > Importantly, since executed without error (it said 10
 > tests run & OK) I assumed it was my lack of experience as the source of
 > the
 > problem. Since, the unit test worked (which  I assume
 > is)
 > I gathered that the fits acceptance testing framework installation should
 > be in working order.
 > I'm a Mac OS 9.x user and am inexperienced with command line interfaces
 > as
 > well as I don't know much about Python (since the Smalltalk version-
 > which
 > I have a better understanding of- wasn't available for download that left
 > Python as my second choice).
 > Since, the Python fit distribution lacked explicit instructions on how to
 > get up and running quickly with the examples I perused for
 > info
 > on MacPython. I resorted to turning into a MacPython
 > applette
 > and invoked the tests via drag & drop. By dragging and dropping one of
 > the
 > example html files and a file called results.html one can simulate the
 > passing of those arguments to a command line with MacPython.
 > By the way, one thing which the platform distributions and the fits Wiki
 > could use would be a simple, highly visible, easy to find, step by step
 > "Hello World" style explanation of how to get an example test to
 > work. Even
 > if it's only in order to simply verify the correct installation of the
 > framework.
 > For reference, I like the way jUnit's test infected and cookbook docs are
 > written. They're simple and to the point. Moreover, they show jUnits key
 > features, motivations and concepts in an straightforwards and easy to
 > understand manner.
 > In contrast, I had a hard time understanding what's up with the fits
 > framework. as a matter of fact, I still am having a hard time
 > understanding
 > it. I couldn't find any succinct introductions on the Wiki. The
 > introductory info seems to be scattered all over the place and no one
 > page
 > offers a good overview on what it does (or how one goes about using it).
 > Nor, could I find a tutorial page on which explained how to get started
 > simply (in a small step by small step manner).
 > I know much of this has to with my own lack of knowledge of programming
 > knowledge. On the other hand, if fits is suppose to help make it easier
 > for
 > customers to participate in Acceptance test writing then perhaps
 > improvements made in the current explanations could help to further
 > encourage customers participating in such tests? Perhaps, explanations
 > along the lines of jUnit's introductory docs (or even the Martin Fowler's
 > intro of jUnit in his Refactoring book) might help further convince
 > non-believer programmers to write automated acceptance tests. As opposed
 > to
 > continuing to do manual ones or none at all.
 > Thanks,
 > Anthony Adachi

test --Simon Michael, 2003/06/23 14:10 GMT reply
Testing subscriber mail-in to

test --simon, 2003/06/23 14:13 GMT reply
Testing reply via web. As a subscriber, I should receive this in email.

a python fit issue tracking page --Simon Michael, 2003/06/24 11:22 GMT reply

Thanks to all of you who sent feedback and bug reports for python fit and apologies for this slow reply.

I've set up a page for tracking and discussing these issues, linked off PythonPlatform?: . You can subscribe there if you want to receive and send comments by email. I would have used one of the existing wikis, but I wanted email support, external editing, issue tracking features, etc.

I assume we won't want to see all the python fit issue chatter on this list, but note we could mutually subscribe the page and this list so those messages would be forwarded both ways (they'd have a PythonFit subject tag).

Best regards, -Simon

Re: Python-Fit & ZWiki? --Simon Michael, Sat, 02 Oct 2004 01:01:14 -0700 reply
I'm cc'ing this to the wiki to gather all in one place.. if you'd prefer not, let me know or remove it.

Wood, Jeff wrote:

I've been looking into Python-Fit & the ZWiki? project. I would like to use these projects for the basis of a larger testing framework.

There seem to be a few features missing that the Java-Fit project has... #1 the view/test paradigm ( pages that follow a testBlah naming pattern are automatically recognized as tests ... These pages feature a "TEST" button that invokes the actual tests embedded in the page... That way people can view the test definitions without necessarily running them. Second, there is a second naming convention that is suiteBoo which lists links to testBlah pages ... The Suite page then invokes all of the tests within each of the pages ... and gives a grand summary so that entire test suites can be built and kicked off with a single click ( again these pages follow the "view/test" paradigm described above ).

Now, beyond that, I have been having troubles with even getting the fit tests to run at all inside of ZWiki?. I test using direct command-line invocation and use the fit sample document/report files and everything is working fine...

Any help you can provide with getting things running smoothly is/would be greatly appreciated...

My goal is to move this to a linux-based platform eventually... but since I have a laptop for my test environment that only has WindowsXP?, that's what I'm using to get things working before I dedicate a linux environment to running this system for me...

Here's an explanation of the test environment I'm using...

I've got Python 2.3.2 ( ActiveState? ) & Zope 2.7.2 installed

I downloaded ZWiki? through darcs & installed it into my $ZOPE_INSTANCE/Products directory.

The wiki itself is running, and parsing STX & RST just fine... I've got Python setup @ C:\Python23

I've got fit setup @ C:\python-fit\fit & my test Fixtures ( ArithmeticFixture?, ArithmeticColumnFixture?, etc ) setup in C:\python-fit\fixtures\

I've added C:\Python23\Lib & C:\python-fit\ to my PYTHONPATH environment variable.

It never runs the tests...

Here's a copy of the test page I'm using ( I've got it set to use RST )


=========== =========== =========== =========== =========== ============



x y plus() times() divide() floating()

  1. 3 5 6 0 0.666667
  2. 0 0 0 error error
  3. 0 0 0
  4. 300 500 60000 0 0.666667
  5. 3 10 10 10
  6. 3 5 6 0 0.666667
  7. -3 -1 -6 0 -0.666667

=========== =========== =========== =========== =========== ============

=========== ==============



=========== ==============

Anyways, any support you can provide would be GREATLY appreciated, I'd love to be able to use & help grow your project.

As a side note... I did find the problem in TypeAdapter? that blows AutoAdapter? when you use Python 2.2 or 2.3 ( r_exec is deprecated )...

I updated my source to simply use eval() instead and removed all references to RExec? and r_exec() ... and it works when I process the pages by hand "python FileRunner?...." Against the sample HTML pages from the Python-Fit project...

Re: Python-Fit & ZWiki? --Simon Michael, Sat, 02 Oct 2004 01:02:29 -0700 reply
Hi Jeff,

thanks for your input on python fit. I haven't touched it in about a year. It's possible there's been some work done on it that I haven't heard about. I think the fit list has been dead for a while.

Now, beyond that, I have been having troubles with even getting the fit tests to run at all inside of ZWiki?.
This at least I can help with. Let me see how I have it working on has some notes.. I see it's broken again. Fixing it was out of my reach right now. Instead I've moved the source to darcs and fixed up the web page. It seems the next task is to apply your eval fix for python 2.3. I wouldn't feel good running that on my server for long though.
Anyways, any support you can provide would be GREATLY appreciated, I'd love to be able to use & help grow your project.

Great! Perhaps we can repost these at or on the fit list to show some signs of life to passers-by. Talk to you later.

never runs the tests --simon, Sat, 02 Oct 2004 01:34:07 -0700 reply
Both of us have this problem right now. Two things that might deactivate tests in a zwiki page:

  1. if the page does not contain some class names beginning with fit. or fixture.
  2. if Zwiki is unable to import fit

Zwiki gives priority to rendering the page rather than revealing fit problems. Here's the source: . If 1. is ok, try removing the try: except: which hides import errors.

never runs the tests --simon, Sat, 02 Oct 2004 01:35:52 -0700 reply
PS I checked in John Roth's minimal rexec fix (to darcs) for python 2.3 compatibility. There may be more needed, patches welcome.

never runs the tests --simon, Sat, 02 Oct 2004 02:55:51 -0700 reply
Working for me now at ZWiki:FitTests . It's necessary to symlink or copy the fit directory to ZWiki?/plugins/ now, not the ZWiki?/ directory.

I have checked in some zwiki changes which will display the fit import error at the top of the page when appropriate.

  ( 1 subscriber )