pyyaml / tests / lib / README.txt

Full commit

Creating a new test module:

1. Create a test_*.py file.

New test modules are put in tests/lib.  For example, to add a test
called "foo" create tests/lib/

Any function named test_* will be run by the test framework if there
are data files to feed it.  For example, in there
is a function called test_marks() which has an attribute:

    test_marks.unittest = ['.marks']

This means any data file that ends with .marks will be fed to this function.

If unittest has multiple items, only data files will be selected if ones
exist with all the extensions.

For example tests/lib/ has this line:

    test_constructor_types.unittest = ['.data', '.code']

If data files, foo.code and bar.code exist, test_constructor_types
will be fed and foo.code but not bar.code (because there
is no

2. Activate the test module.

Import the module in tests/lib/  i.e. add a line like:
from test_foo import *

Note: test_marks and are relatively simple
examples to look at when creating your own test module.

Running tests:

To run all tests:
    make testall

To just run test tests in module
    make ; YAML_TEST_FILENAMES=test_dictorder /usr/bin/python tests/lib/
    make ; YAML_TEST_FILENAMES=test_dictorder /usr/bin/python tests/lib/ -v