Skip to content

Use a pytest fixture when the layout is not important - #947

Merged
Debilski merged 2 commits into
ASPP:mainfrom
Debilski:feature/layout_fixtures
Mar 30, 2026
Merged

Use a pytest fixture when the layout is not important#947
Debilski merged 2 commits into
ASPP:mainfrom
Debilski:feature/layout_fixtures

Conversation

@Debilski

Copy link
Copy Markdown
Member

Basically I am specifying a dummy layout (on a per-file basis currently), parse and make it available in the dummy_layout_dict fixture variable:

@pytest.fixture
def dummy_layout():
    return """
        ##########
        #  b  y  #
        #a  ..  x#
        ##########
    """

@pytest.fixture
def dummy_layout_dict(dummy_layout):
    # Use this when a simple layout is needed but the details don’t matter
    return pelita.layout.parse_layout(dummy_layout)

Tests can then use it like

def test_something(dummy_layout_dict):
    # do something that needs a dummy_layout_dict but does not really use it
    ...

@Debilski
Debilski merged commit 8268406 into ASPP:main Mar 30, 2026
36 checks passed
@Debilski
Debilski deleted the feature/layout_fixtures branch March 30, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant