File: test_scalar.py

package info (click to toggle)
python-suitesparse-graphblas 7.4.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 968 kB
  • sloc: ansic: 9,939; python: 3,575; sh: 52; makefile: 8
file content (12 lines) | stat: -rw-r--r-- 379 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
import pytest

from suitesparse_graphblas import ffi, lib, supports_complex  # noqa


@pytest.mark.skipif("not supports_complex()")
def test_complex():
    s = ffi.new("GrB_Scalar*")
    success = lib.GrB_SUCCESS
    assert lib.GrB_Scalar_new(s, lib.GxB_FC64) == success
    assert lib.GxB_Scalar_setElement_FC64(s[0], 1j) == success
    assert lib.GrB_Scalar_free(s) == success