File: test_cython.py

package info (click to toggle)
python-ulid-transform 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 380 kB
  • sloc: cpp: 942; python: 695; sh: 5; makefile: 4
file content (12 lines) | stat: -rw-r--r-- 374 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
import os

import pytest


def test_require_cython():
    """Fail if REQUIRE_CYTHON is set and the Cython module is not available."""
    if os.environ.get("REQUIRE_CYTHON", "").lower() not in ("1", "true", "yes"):
        pytest.skip("REQUIRE_CYTHON is not truthy")
    import ulid_transform._ulid_impl as c_impl

    assert repr(c_impl.ulid_now).startswith("<cyfunction")