tools.test_runner

class openfisca_core.tools.test_runner.YamlFile(*k, **kw)[source]
collect()[source]

returns a list of children (items and collectors) for this collection node.

class openfisca_core.tools.test_runner.YamlItem(*k, **kw)[source]

Terminal nodes of the test collection tree.

openfisca_core.tools.test_runner.run_tests(tax_benefit_system, paths, options=None)[source]

Runs all the YAML tests contained in a file or a directory.

If path is a directory, subdirectories will be recursively explored.

Parameters
  • tax_benefit_system (TaxBenefitSystem) – the tax-benefit system to use to run the tests

  • paths (str or list) – A path, or a list of paths, towards the files or directories containing the tests to run. If a path is a directory, subdirectories will be recursively explored.

  • options (dict) – See more details below.

:raises AssertionError: if a test does not pass

Returns

the number of sucessful tests excecuted

Testing options:

Key

Type

Role

verbose

bool

See openfisca test options doc

name_filter

str

Tests can also be run in the console with openfisca test.