File: conftest.py

package info (click to toggle)
python-syrupy 4.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,368 kB
  • sloc: python: 5,978; makefile: 3
file content (33 lines) | stat: -rw-r--r-- 878 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from typing import List

import pytest

# Constants for testing with extra plugin arguments
_NO_ARGS = []
_XDIST_ZERO = ["--numprocesses", "0"]
_XDIST_TWO = ["--numprocesses", "2"]


@pytest.fixture(
    params=[_NO_ARGS, _XDIST_ZERO, _XDIST_TWO],
    ids=["no_plugin", "xdist_zero", "xdist_two"],
)
def plugin_args(request: pytest.FixtureRequest) -> List[str]:
    """Fixture to test with various plugins"""
    return request.param


@pytest.fixture(
    params=[
        _NO_ARGS,
        _XDIST_ZERO,
        pytest.param(
            _XDIST_TWO,
            marks=pytest.mark.xfail(reason="Not currently compatible with xdist"),
        ),
    ],
    ids=["no_plugin", "xdist_zero", "xdist_two"],
)
def plugin_args_fails_xdist(request: pytest.FixtureRequest) -> List[str]:
    """Fixture to test with various plugins, but expected to fail xdist"""
    return request.param