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
3 changes: 1 addition & 2 deletions bindings/pyroot/cppyy/cppyy/test/test_fragile.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_fragile.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_fragile.py:1:12: F401 `sys` imported but unused help: Remove unused import

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

View workflow job for this annotation

GitHub Actions / ruff

ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_fragile.py:1:8: F401 `os` imported but unused help: Remove unused import

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

View workflow job for this annotation

GitHub Actions / ruff

ruff (E401)

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

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

View workflow job for this annotation

GitHub Actions / ruff

ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_fragile.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_fragile.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (I001)

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

Expand Down Expand Up @@ -151,7 +151,7 @@
fragile = cppyy.gbl.fragile
assert cppyy.gbl.fragile is fragile

g = fragile.G()

Check failure on line 154 in bindings/pyroot/cppyy/cppyy/test/test_fragile.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F841)

bindings/pyroot/cppyy/cppyy/test/test_fragile.py:154:9: F841 Local variable `g` is assigned to but never used help: Remove assignment to unused variable `g`

def test08_unhandled_scoped_datamember(self):
"""Test that an unhandled scoped data member does not cause infinite recursion"""
Expand All @@ -162,7 +162,7 @@
fragile = cppyy.gbl.fragile
assert cppyy.gbl.fragile is fragile

h = fragile.H()

Check failure on line 165 in bindings/pyroot/cppyy/cppyy/test/test_fragile.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F841)

bindings/pyroot/cppyy/cppyy/test/test_fragile.py:165:9: F841 Local variable `h` is assigned to but never used help: Remove assignment to unused variable `h`

def test09_operator_bool(self):
"""Access to global vars with an operator bool() returning False"""
Expand Down Expand Up @@ -216,7 +216,7 @@
assert f.__doc__ == "void fragile::fglobal(int, double, char)"

try:
o = fragile.O() # raises TypeError

Check failure on line 219 in bindings/pyroot/cppyy/cppyy/test/test_fragile.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F841)

bindings/pyroot/cppyy/cppyy/test/test_fragile.py:219:13: F841 Local variable `o` is assigned to but never used help: Remove assignment to unused variable `o`
assert 0
except TypeError as e:
assert "cannot instantiate abstract class 'fragile::O'" in str(e)
Expand Down Expand Up @@ -266,7 +266,7 @@
S(int a, int c): _a{a}, _c{c} { }
S(): _a{0}, _c{0} { }
bool operator<(int i) { return i < (_a+_c); }
}; }""");

Check failure on line 269 in bindings/pyroot/cppyy/cppyy/test/test_fragile.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E703)

bindings/pyroot/cppyy/cppyy/test/test_fragile.py:269:17: E703 Statement ends with an unnecessary semicolon help: Remove unnecessary semicolon


assert 'S' in dir(cppyy.gbl.GG)
Expand Down Expand Up @@ -298,7 +298,7 @@

# TODO: namespaces aren't loaded (and thus not added to sys.modules)
# with just the from ... import statement; actual use is needed
from cppyy.gbl import fragile

Check failure on line 301 in bindings/pyroot/cppyy/cppyy/test/test_fragile.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_fragile.py:301:31: F401 `cppyy.gbl.fragile` imported but unused help: Remove unused import: `cppyy.gbl.fragile`

def fail_import():
from cppyy.gbl import does_not_exist
Expand Down Expand Up @@ -544,13 +544,12 @@
assert "invaliddigit" in err
assert "1aap=42;" in err

@mark.xfail(strict=True, condition=not IS_WINDOWS, reason="Fails on Windows")
def test22_cppexec(self):
"""Interactive access to the Cling global scope"""

import cppyy

cppyy.cppexec("int interactive_b = 4")
cppyy.cppdef("int interactive_b = 4;")
assert cppyy.gbl.interactive_b == 4

with raises(SyntaxError):
Expand Down
Loading