thegooglecodearchive / sfepy

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

add docstring to testsBasic.py and runTests.py #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by ondrej.c...@gmail.com on 5 Feb 2008 at 4:35

GoogleCodeExporter commented 9 years ago
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.

Original comment by ondrej.c...@gmail.com on 5 Feb 2008 at 4:39

GoogleCodeExporter commented 9 years ago
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).

Original comment by robert.c...@gmail.com on 5 Feb 2008 at 4:49

GoogleCodeExporter commented 9 years ago
Excellent, let's put this into the docstring and then close this issue.

Original comment by ondrej.c...@gmail.com on 5 Feb 2008 at 5:24

GoogleCodeExporter commented 9 years ago
done. I have also added --print-doc option to runTests.py.

Original comment by robert.c...@gmail.com on 6 Feb 2008 at 10:09

GoogleCodeExporter commented 9 years ago
Perfect, great job, thanks!

Original comment by ondrej.c...@gmail.com on 6 Feb 2008 at 10:25

GoogleCodeExporter commented 9 years ago
Perfect, great job, thanks!

Original comment by ondrej.c...@gmail.com on 6 Feb 2008 at 10:25

GoogleCodeExporter commented 9 years ago
Migrated to http://github.com/sfepy/sfepy/issues/19

Original comment by robert.c...@gmail.com on 30 Jan 2012 at 10:24