sfepy/sfepy — Issue #19: add docstring to testsBasic.py and runTests.py
Author: rc
Created: 2012-01-30 10:24:02+00:00
State: open

Please add a module docstring to tests/testsBasic.py, something like this:

"""
This module is not a test file, it contains some useful classes, that are
imported from some test files.
"""

Then apparently there is some magic going on. For example
tests/test_input_kostka.py contains:

inputName = 'input/kostka.py'

however this variable is not called from testsBasic.TestInput, so how this
works should be explained in the module docstring in the file

runTests.py

Migrated from http://code.google.com/p/sfepy/issues/detail?id=15

earlier comments

ondrej.certik said, at 2008-02-05T16:39:07.000Z:

Also please explain in runTests.py docstring how to write my own new tests.

You don't have to explain all the details (I can copy some existing test file as a
starting point), but just a few sentences how it works and what the testfile is
supposed to do and what it should contain and return would be very helpful.

robert.cimrman said, at 2008-02-05T16:49:49.000Z:

short explanation first:

All variables defined in a test file are collected in 'conf', so inputName is in
conf.inputName.

A test file can contain anything, but usually it is similar to a regular input file
(defining a test problem), with a mandatory Test class. This class holds all the
test_* functions, as well as the fromConf(), which serves to initialize the test
(conf is in fact the test file itself, options are command-line options)

The test_* functions are colelcted automatically by runTests.py, with one exception:
if a certain order of their evaluation is required, a class attribute 'test' of the
Test class with a list of the test function names should be defined (example:
test_meshio.py).

ondrej.certik said, at 2008-02-05T17:24:32.000Z:

Excellent, let's put this into the docstring and then close this issue.

robert.cimrman said, at 2008-02-06T10:09:53.000Z:

done. I have also added --print-doc option to runTests.py.

ondrej.certik said, at 2008-02-06T10:25:15.000Z:

Perfect, great job, thanks!

ondrej.certik said, at 2008-02-06T10:25:16.000Z:

Perfect, great job, thanks!