policyengine_core.tools module contains miscellaneous utility functions, including for running YAML tests.
- policyengine_core.tools.test_runner.run_tests(tax_benefit_system, paths, options=None)#
Runs all the YAML tests contained in a file or a directory.
If path is a directory, subdirectories will be recursively explored.
tax_benefit_system (TaxBenefitSystem) – the tax-benefit system to use to run the tests
paths ((str/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.
AssertionError – if a test does not pass
the number of sucessful tests excecuted
- policyengine_core.tools.simulation_dumper.dump_simulation(simulation, directory)#
Write simulation data to directory, so that it can be restored later.
- policyengine_core.tools.simulation_dumper.restore_simulation(directory, tax_benefit_system, **kwargs)#
Restore simulation from directory