File: test_group_warnings_by_message.py

package info (click to toggle)
pytest 9.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,308 kB
  • sloc: python: 65,808; makefile: 45
file content (24 lines) | stat: -rw-r--r-- 333 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# mypy: allow-untyped-defs
from __future__ import annotations

import warnings

import pytest


def func(msg):
    warnings.warn(UserWarning(msg))


@pytest.mark.parametrize("i", range(5))
def test_foo(i):
    func("foo")


def test_foo_1():
    func("foo")


@pytest.mark.parametrize("i", range(5))
def test_bar(i):
    func("bar")