Focus3D / crunchy

Automatically exported from code.google.com/p/crunchy
0 stars 0 forks source link

Automated unit tests #45

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, crunchy has a doctest feature which could be used to run unit
tests one at a time, by having a user click on a button each time.  This
would clearly not be suitable for automated testing.

At the same time, the doctest module has a feature where a user can run
tests contained in a text file, with tests (simulated interpreter session)
can be embedded in the file together with comments.  However, these text
files are not visually interesting to read.

As a first step, it would be interesting to have a new vlam mode, perhaps
called doctest_unit_test, where tests would be kept in a Crunchy ready html
file and could be run either individually (at the click of a "local"
button) or globally (at the click of a "global" button).  The only content
of such files would be texts, simulated Python session and execution
buttons i.e. no editing facility (textarea) would be needed.

Such a feature may be seen as useful for people doing test driven
development, encouraging them to use Crunchy.  This could be later extended
to other types of unit tests.

Eventually, with a txt2html utility, a lot of the formatting issues could
be handled automatically, and existing ".txt" doctest files could be converted.

Original issue reported on code.google.com by andre.ro...@gmail.com on 4 May 2007 at 11:51

GoogleCodeExporter commented 8 years ago
Andre: Could you clarify please - how would code be loaded into Crunchy if 
there is
no editing facility?

Original comment by johannes...@gmail.com on 23 Jun 2007 at 9:09

GoogleCodeExporter commented 8 years ago
"smart alec" answer: run an existing doctest without entering any user code in 
the
editor.  The (doctest) code is loaded inside Crunchy just fine.  

Imagine a case where there is no user code needed to satisfy a doctest - this 
is the
situation you have when keeping doctest-based unit tests in a .txt file.  Unit 
tests
are supposed to be run automatically, without user input (hence, without an 
editor).
 Crunchy does not need an editor/textarea to extract code inside a <pre> and run it.

(This question was adressed more fully in an email response to Bryan.)

Original comment by andre.ro...@gmail.com on 23 Jun 2007 at 12:42

GoogleCodeExporter commented 8 years ago
After discussion on a python-testing list, this feature was deemed to be not 
needed.

Original comment by andre.ro...@gmail.com on 23 Nov 2007 at 11:36