pytest-trio icon indicating copy to clipboard operation
pytest-trio copied to clipboard

options for `run()` args like `strict_exception_groups`

Open belm0 opened this issue 1 year ago • 2 comments

I'd like to set something in pytest.ini to call run() with a certainstrict_exception_groups value, so that it affects nursery fixtures, etc.

belm0 avatar Mar 27 '24 04:03 belm0

hack:

import pytest_trio
pytest_trio.plugin.choose_run = lambda config: partial(trio.run, strict_exception_groups=False)

Why I want this: my package tests should be able to work with various versions of trio, including those prior to having any strict_exception_groups option.

belm0 avatar Mar 27 '24 04:03 belm0

Perhaps it should be a fixture, or maybe a mark - either way it'd be good to offer either forcing it to be true, false, or parametrising the test to run in both modes.

TeamSpen210 avatar Mar 27 '24 04:03 TeamSpen210