Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bindings/pyroot/cppyy/cppyy/test/test_templates.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, pytest, os

Check failure on line 1 in bindings/pyroot/cppyy/cppyy/test/test_templates.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_templates.py:1:8: F401 `py` imported but unused

Check failure on line 1 in bindings/pyroot/cppyy/cppyy/test/test_templates.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E401)

bindings/pyroot/cppyy/cppyy/test/test_templates.py:1:1: E401 Multiple imports on one line
from pytest import mark, raises
from support import setup_make, pylong

Check failure on line 3 in bindings/pyroot/cppyy/cppyy/test/test_templates.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_templates.py:3:21: F401 `support.setup_make` imported but unused

Check failure on line 3 in bindings/pyroot/cppyy/cppyy/test/test_templates.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (I001)

bindings/pyroot/cppyy/cppyy/test/test_templates.py:1:1: I001 Import block is un-sorted or un-formatted

Expand Down Expand Up @@ -29,8 +29,8 @@
def test01_template_member_functions(self):
"""Template member functions lookup and calls"""

import cppyy
import sys

Check failure on line 33 in bindings/pyroot/cppyy/cppyy/test/test_templates.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (I001)

bindings/pyroot/cppyy/cppyy/test/test_templates.py:32:9: I001 Import block is un-sorted or un-formatted

m = cppyy.gbl.MyTemplatedMethodClass()

Expand All @@ -46,7 +46,7 @@
if sys.hexversion >= 0x3000000:
targ = 'long'
else:
targ = long

Check failure on line 49 in bindings/pyroot/cppyy/cppyy/test/test_templates.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F821)

bindings/pyroot/cppyy/cppyy/test/test_templates.py:49:20: F821 Undefined name `long`
assert m.get_size[targ]() == m.get_long_size()

import ctypes
Expand Down Expand Up @@ -110,19 +110,19 @@
from cppyy.gbl.std import vector
# float in, float out
ggsr = cppyy.gbl.global_get_some_result['std::vector<float>']
assert type(ggsr(vector['float']([0.5])).m_retval) == float

Check failure on line 113 in bindings/pyroot/cppyy/cppyy/test/test_templates.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E721)

bindings/pyroot/cppyy/cppyy/test/test_templates.py:113:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
assert ggsr(vector['float']([0.5])).m_retval == 0.5
# int in, float out
ggsr = cppyy.gbl.global_get_some_result['std::vector<int>']
assert type(ggsr(vector['int']([5])).m_retval) == float

Check failure on line 117 in bindings/pyroot/cppyy/cppyy/test/test_templates.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E721)

bindings/pyroot/cppyy/cppyy/test/test_templates.py:117:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
assert ggsr(vector['int']([5])).m_retval == 5.
# float in, int out
ggsr = cppyy.gbl.global_get_some_result['std::vector<float>, int']
assert type(ggsr(vector['float']([0.3])).m_retval) == int

Check failure on line 121 in bindings/pyroot/cppyy/cppyy/test/test_templates.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E721)

bindings/pyroot/cppyy/cppyy/test/test_templates.py:121:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
assert ggsr(vector['float']([0.3])).m_retval == 0
# int in, int out
ggsr = cppyy.gbl.global_get_some_result['std::vector<int>, int']
assert type(ggsr(vector['int']([5])).m_retval) == int

Check failure on line 125 in bindings/pyroot/cppyy/cppyy/test/test_templates.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E721)

bindings/pyroot/cppyy/cppyy/test/test_templates.py:125:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
assert ggsr(vector['int']([5])).m_retval == 5

def test04_variadic_function(self):
Expand Down Expand Up @@ -1118,6 +1118,7 @@
run_n = getattr(cppyy.gbl, 'TNaRun_%d' % n)
getattr(run_n, t)

@mark.xfail(run = False, reason = "This test crashes sporadically")
def test33_using_template_argument(self):
"""`using` type as template argument"""

Expand Down
Loading