tests: simplify tests for my.core.serialize a bit and simplify tox file

This commit is contained in:
Dima Gerasimov 2024-08-06 23:09:56 +01:00
parent 3aebc573e8
commit 65dbdc44ef
6 changed files with 109 additions and 88 deletions

22
my/core/pytest.py Normal file
View file

@ -0,0 +1,22 @@
"""
Helpers to prevent depending on pytest in runtime
"""
from .common import assert_subpackage; assert_subpackage(__name__)
import sys
import typing
under_pytest = 'pytest' in sys.modules
if typing.TYPE_CHECKING or under_pytest:
import pytest
parametrize = pytest.mark.parametrize
else:
def parametrize(*args, **kwargs):
def wrapper(f):
return f
return wrapper