1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
import pytest
import tests.conftest # noqa
example = "01J3MS6XG9XC7X9FR15J9A82ZP"
@pytest.mark.benchmark(group="ulid_parsing")
def test_ut_decode(benchmark, impl):
assert isinstance(benchmark(lambda: impl.ulid_to_bytes(example)), bytes)
@pytest.mark.benchmark(group="ulid_parsing")
def test_ulid2_decode(benchmark):
ulid2 = pytest.importorskip("ulid2")
assert isinstance(benchmark(lambda: ulid2.decode_ulid_base32(example)), bytes)
@pytest.mark.benchmark(group="ulid_parsing")
def test_ulidpy_decode(benchmark):
ulid = pytest.importorskip("ulid")
assert isinstance(benchmark(lambda: ulid.from_str(example).bytes), bytes)
|