godatadriven/pytest-dbt-core

[Feature] Flag to set the target

Closed this issue · 0 comments

Is this your first time opening an issue?

Describe the Feature

Add a flag to set the target.

Describe alternatives you've considered

Do not set a specific target, use the default target

Who will this benefit?

Everyone who does not want to use the default target

Are you interested in contributing this feature?

yes

Anything else?

Add flag to plugin:

# src/pytest_dbt_core/plugin.py
...
def pytest_addoption(...):
    ....
    
    parser.addoption(
        "--dbt-target",
        help="Which target to load for the given profile",
        type="string",
    )

And test in the example project in tests/