def
create_test_fixture
cauldron.steptest.create_test_fixture()

Creates a pytest fixture for step testing within the current project.

Arguments
Required
Optional
test_file_path

str

Path to the test file being executed, usually __file__.

fixture_name

str

Name of the fixture to use as the argument in tests. By default this will be tester.

Default Value: 

tester

Returns

A pytest fixture that will be scoped to the test module in which it has been created.

Basic Usage
The example below shows how to create and use a test fixture.
01
02
03
04
05
06
07
from cauldron import steptest test_fixture = steptest.create_test_fixture(__file__) def test_notebook_step(tester: steptest.CauldronTest): """Should run notebook step without error.""" tester.run_step('S01-Load-Data.py')
By default the name of the fixture within tests will be called "tester". However, that can be changed to whatever you want it to be by specifying the fixture_name argument when creating the fixture. The above example with a custom fixture name would look like:
01
02
03
04
05
06
07
from cauldron import steptest test_fixture = steptest.create_test_fixture(__file__, fixture_name='foo') def test_notebook_step(foo: steptest.CauldronTest): """Should run notebook step without error.""" foo.run_step('S01-Load-Data.py')