skipcheck

TM1 Testcontainers · Docs · Writing tests

RequiresCognos

from skipcheck_tm1_testcontainers import RequiresCognos

Runs a test class or method that needs IBM Cognos Analytics (CAM security) as well as TM1, and skips it when either isn't available.

It includes RequiresTm1, so tests also skip without Docker or a Tm1Source. Declare a CognosSource parameter to get the source CognosSource.discover found. Cognos takes minutes to start and its test users vary by test, so there's no shared Cognos: build a CognosContainer with the users the test needs.

@pytest.mark.requires_cognos
def test_readers_can_only_read(cognos: CognosSource) -> None:
    # No shared Cognos: each test starts its own, with the users it needs
    with CognosContainer(cognos).with_user("viewer", "viewerpw", "Readers"):
        ...

Members

NO_SOURCE_MESSAGE staticWhy tests skip when no Cognos source is configured, and what to set.
mark property

NO_SOURCE_MESSAGE

static
NO_SOURCE_MESSAGE

Why tests skip when no Cognos source is configured, and what to set.

mark

property
mark