def pytest_collection_modifyitems(items, config):
    """Override Pytest config at run-time to run tests using Stripe API only if explictly specified using `-m stripe_api`"""
    # get passed in markers
    markexpr = config.getoption("markexpr")
    if markexpr:
        # allow passed in markers to run
        config.option.markexpr = markexpr
    else:
        # skip running `stripe_api` marked tests unless explictly specified
        for item in items:
            if "stripe_api" in item.keywords:
                # add message to let user know how to run tests using Stripe API
                item.add_marker(
                    pytest.mark.skip(reason="need -m stripe_api option to run")
                )
Override Pytest config at run-time to run tests using Stripe API only if explictly specified using `-m stripe_api`
tests/conftest.py