[Cuis-dev] Tests

Luciano Notarfrancesco luchiano at gmail.com
Mon Aug 15 02:48:43 PDT 2022


I have subclasses of TestCase that hold more state besides the test
selector. For example I have a subclass with a 'seed' instance variable
that is set randomly in >>#initialize, and a 'random' instance variable
that is set to 'Random seed: seed' in >>#setUp. This allows me to write
tests that use randomness and are reproducible. But when debugging a test
that failed, a new TestCase instance is created and the new TestCase is
debugged instead, so the original seed is lost and my tests are not
reproducible. I'm also experimenting with generic tests, for example I have
a generic VectorSpaceTest with an instance variable 'scalars' for the
coefficients field, so I can create a test suit with tests for vector
spaces over the rationals, Z/pZ, rational functions, etc (vector spaces
over different 'scalars'), but again the scalars are lost when I try to
debug a test. I don't see any reason to create new instances of the test
cases when debugging, see the attached change set and let me know if you
agree with it.

Also, when a test was taking too long I used to click the stop button in
the test runner and a debugger would open, so I what it was doing. But now
the test runner just stops without opening a debugger.

Thanks,
Luciano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220815/fb72df8b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5449-DontCreateNewTestCaseInstances-LucianoEstebanNotarfrancesco-2022Aug15-08h16m-len.001.cs.st
Type: application/octet-stream
Size: 393 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220815/fb72df8b/attachment.obj>


More information about the Cuis-dev mailing list