Skip to content

Use pytest.mark.parametrize for IP4SCOUT test files #32

@dannywillems

Description

@dannywillems

Problem

IP4SCOUT_FILES is discovered at module import time. If the test directory is missing or empty, the test loop body never executes and the test silently passes.

Proposal

Use pytest.mark.parametrize so each file is a distinct test case. Zero files becomes visible in test output instead of silently passing.

@pytest.mark.parametrize("path", IP4SCOUT_FILES, ids=lambda p: p.name)
def test_l9event_from_ip4scout(path):
    with open(path) as f:
        c = json.load(f)
    l9format.L9Event.from_dict(c)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions