File: test_primitives.py

package info (click to toggle)
python-cattrs 25.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,812 kB
  • sloc: python: 12,236; makefile: 155
file content (17 lines) | stat: -rw-r--r-- 425 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pytest

from cattr import BaseConverter, Converter


@pytest.mark.parametrize("converter_cls", [BaseConverter, Converter])
def test_unstructure_int(benchmark, converter_cls):
    c = converter_cls()

    benchmark(c.unstructure, 5)


@pytest.mark.parametrize("converter_cls", [BaseConverter, Converter])
def test_unstructure_float(benchmark, converter_cls):
    c = converter_cls()

    benchmark(c.unstructure, 15.0)