pyyaml / tests / lib /

Filename Size Date modified Message
1.4 KB
12.1 KB
315 B
5.2 KB
342 B
351 B
1.2 KB
9.0 KB
1.6 KB
4.3 KB
2.0 KB
6.1 KB
1.0 KB
1.0 KB
1.3 KB
1.5 KB
3.3 KB
6.7 KB
2.3 KB
457 B
10.4 KB
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