singer_sdk.testing.runners.TargetTestRunner

class singer_sdk.testing.runners.TargetTestRunner[source]

Utility class to simplify target testing.

__init__(target_class, config=None, suite_config=None, input_filepath=None, input_io=None, **kwargs)[source]

Initialize TargetTestRunner.

Parameters:
  • target_class (type[Target]) – Target Class to instantiate.

  • config (dict | None) – Config to pass to instantiated Target.

  • suite_config (SuiteConfig | None) – Config to pass to tests.

  • input_filepath (Path | Traversable | None) – (optional) Path to a singer file containing records, to pass to the Target during testing.

  • input_io (io.StringIO | None) – (optional) StringIO containing raw records to pass to the Target during testing.

  • kwargs (t.Any) – Default arguments to be passed to tap/target on create.

Return type:

None

new_target()[source]

Get new Target instance.

Returns:

A configured Target instance.

Return type:

Target

sync_all(*, finalize=True, **kwargs)[source]

Run a full tap sync, assigning output to the runner object.

Parameters:
  • finalize (bool) – True to process as the end of stream as a completion signal; False to keep the sink operation open for further records.

  • kwargs (Any) – Unused keyword arguments.

Return type:

None

property target_input: IO[str][source]

Input messages to pass to Target.

Returns:

A list of raw input messages in string form.