File: helpers.py

package info (click to toggle)
python-pytest-trio 0.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 464 kB
  • sloc: python: 944; sh: 49; makefile: 20
file content (23 lines) | stat: -rw-r--r-- 610 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pytest


def enable_trio_mode_via_pytest_ini(testdir):
    testdir.makefile(".ini", pytest="[pytest]\ntrio_mode = true\n")


def enable_trio_mode_trio_run_via_pytest_ini(testdir):
    testdir.makefile(".ini", pytest="[pytest]\ntrio_mode = true\ntrio_run = trio\n")


def enable_trio_mode_via_conftest_py(testdir):
    testdir.makeconftest("from pytest_trio.enable_trio_mode import *")


enable_trio_mode = pytest.mark.parametrize(
    "enable_trio_mode",
    [
        enable_trio_mode_via_pytest_ini,
        enable_trio_mode_trio_run_via_pytest_ini,
        enable_trio_mode_via_conftest_py,
    ],
)