Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pytest test parametrization via nanaimo.cfg #125

Open
kcandow opened this issue Apr 6, 2020 · 0 comments
Open

Support pytest test parametrization via nanaimo.cfg #125

kcandow opened this issue Apr 6, 2020 · 0 comments

Comments

@kcandow
Copy link

kcandow commented Apr 6, 2020

Parametrizing Pytest tests and fixtures makes testing different setups and configuration more natural. The pytest concept of parametrizing translates well to the nanaimo concept of testing different hardware configurations on a single test rig.

Assume that a test rig may have any number of widgets that all respond to the foo test. A parametrized test would look like this:

@pytest.mark.asyncio
@pytest.mark.parametrize("widget_id", ["w0", "w1", "w2"])
async def test_foo(foo_fixture):
    assert_success(await foo_fixture.gather(dut=widget_id))

Ideally, the list of widgets (w0, w1, w2) would live in /etc/nanaimo.cfg, not in the test file.

Right now, /etc/nanaimo.cfg is used to specify the default arguments for fixtures, but the outputs of a fixture cannot be used to parametrize a test or a fixture, [2].

This issue is for a feature that allows pytest parametrization via /etc/nanaimo.cfg (or another fixed, test rig-specific file).

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

No branches or pull requests

1 participant