Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions bindings/pyroot/cppyy/cppyy/test/test_regression.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, sys, pytest

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

View workflow job for this annotation

GitHub Actions / ruff

ruff (E401)

bindings/pyroot/cppyy/cppyy/test/test_regression.py:1:1: E401 Multiple imports on one line help: Split imports
from pytest import mark, raises, skip
from support import setup_make, IS_WINDOWS, ispypy, IS_MAC, IS_MAC_ARM

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

View workflow job for this annotation

GitHub Actions / ruff

ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_regression.py:3:21: F401 `support.setup_make` imported but unused help: Remove unused import: `support.setup_make`

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

View workflow job for this annotation

GitHub Actions / ruff

ruff (I001)

bindings/pyroot/cppyy/cppyy/test/test_regression.py:1:1: I001 Import block is un-sorted or un-formatted help: Organize imports

Expand All @@ -7,7 +7,7 @@
helpout = []

def setup_class(cls):
import cppyy

Check failure on line 10 in bindings/pyroot/cppyy/cppyy/test/test_regression.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_regression.py:10:16: F401 `cppyy` imported but unused help: Remove unused import: `cppyy`

if sys.hexversion < 0x30d0000:
def stringpager(text, cls=cls):
Expand All @@ -22,7 +22,7 @@
def test01_kdcraw(self):
"""Doc strings for KDcrawIface (used to crash)."""

import cppyy, pydoc

Check failure on line 25 in bindings/pyroot/cppyy/cppyy/test/test_regression.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (I001)

bindings/pyroot/cppyy/cppyy/test/test_regression.py:25:9: I001 Import block is un-sorted or un-formatted help: Organize imports

Check failure on line 25 in bindings/pyroot/cppyy/cppyy/test/test_regression.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E401)

bindings/pyroot/cppyy/cppyy/test/test_regression.py:25:9: E401 Multiple imports on one line help: Split imports

# TODO: run a find for these paths
qtpath = "/usr/include/qt5"
Expand Down Expand Up @@ -54,9 +54,9 @@
if ispypy:
skip('hangs (??) in pypy')

import cppyy, pydoc

Check failure on line 57 in bindings/pyroot/cppyy/cppyy/test/test_regression.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (I001)

bindings/pyroot/cppyy/cppyy/test/test_regression.py:57:9: I001 Import block is un-sorted or un-formatted help: Organize imports

Check failure on line 57 in bindings/pyroot/cppyy/cppyy/test/test_regression.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E401)

bindings/pyroot/cppyy/cppyy/test/test_regression.py:57:9: E401 Multiple imports on one line help: Split imports

assert not '__abstractmethods__' in dir(cppyy.gbl.gInterpreter)

Check failure on line 59 in bindings/pyroot/cppyy/cppyy/test/test_regression.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E713)

bindings/pyroot/cppyy/cppyy/test/test_regression.py:59:20: E713 Test for membership should be `not in` help: Convert to `not in`
assert '__class__' in dir(cppyy.gbl.gInterpreter)

self.__class__.helpout = []
Expand All @@ -68,7 +68,7 @@

cppyy.cppdef("namespace cppyy_regression_test { void iii() {}; }")

assert not 'iii' in cppyy.gbl.cppyy_regression_test.__dict__

Check failure on line 71 in bindings/pyroot/cppyy/cppyy/test/test_regression.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E713)

bindings/pyroot/cppyy/cppyy/test/test_regression.py:71:20: E713 Test for membership should be `not in` help: Convert to `not in`
assert not '__abstractmethods__' in dir(cppyy.gbl.cppyy_regression_test)
assert '__class__' in dir(cppyy.gbl.cppyy_regression_test)
assert 'iii' in dir(cppyy.gbl.cppyy_regression_test)
Expand Down Expand Up @@ -473,7 +473,6 @@

assert a != b # derived class' C++ operator!= called

@mark.xfail(strict=True)
def test18_operator_plus_overloads(self):
"""operator+(string, string) should return a string"""

Expand All @@ -485,7 +484,10 @@
assert a == 'a'
assert b == 'b'

assert type(a+b) == cppyy.gbl.std.string
# Expect same return type as other funcs returning a std::string in
# C++, which might be different from gbl.std.string on the Python side
# depending on the enabled Pythonizations.
assert type(a + b) == type(cppyy.gbl.std.to_string(42))
assert a+b == 'ab'

def test19_std_string_hash(self):
Expand Down
6 changes: 4 additions & 2 deletions bindings/pyroot/cppyy/cppyy/test/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,6 @@ def test33_using_template_argument(self):
assert ns.testptr
assert cppyy.gbl.std.vector[ns.testptr]

@mark.xfail(strict=True)
def test34_cstring_template_argument(self):
"""`const char*` use over std::string"""

Expand All @@ -1160,7 +1159,10 @@ def test34_cstring_template_argument(self):

ns = cppyy.gbl.CStringTemplateArg

assert type(ns.stringify("Alice")) == cppyy.gbl.std.string
# Expect same return type as other funcs returning a std::string in
# C++, which might be different from gbl.std.string on the Python side
# depending on the enabled Pythonizations.
assert type(ns.stringify("Alice")) == type(cppyy.gbl.std.to_string(42))
assert ns.stringify("Alice", "Bob") == "Alice Bob "
assert ns.stringify(1, 2, 3) == "1 2 3 "
assert ns.stringify["const char*"]("Aap") == "Aap "
Expand Down
Loading