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
16 changes: 8 additions & 8 deletions bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pytest, os

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

View workflow job for this annotation

GitHub Actions / ruff

ruff (F401)

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

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

View workflow job for this annotation

GitHub Actions / ruff

ruff (E401)

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

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

View workflow job for this annotation

GitHub Actions / ruff

ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.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_advancedcpp.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (I001)

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

Expand Down Expand Up @@ -154,7 +154,7 @@
import cppyy
gbl = cppyy.gbl

lib2 = cppyy.load_reflection_info("advancedcpp2_cxx")

Check failure on line 157 in bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F841)

bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py:157:9: F841 Local variable `lib2` is assigned to but never used help: Remove assignment to unused variable `lib2`

assert gbl.a_ns is gbl.a_ns
assert gbl.a_ns.d_ns is gbl.a_ns.d_ns
Expand Down Expand Up @@ -186,8 +186,8 @@
assert gbl.T1 is gbl.T1
assert gbl.T2 is gbl.T2
assert gbl.T3 is gbl.T3
assert not gbl.T1 is gbl.T2

Check failure on line 189 in bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E714)

bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py:189:20: E714 Test for object identity should be `is not` help: Convert to `is not`
assert not gbl.T2 is gbl.T3

Check failure on line 190 in bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E714)

bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py:190:20: E714 Test for object identity should be `is not` help: Convert to `is not`

assert gbl.T1('int') is gbl.T1('int')
assert gbl.T1(int) is gbl.T1('int')
Expand Down Expand Up @@ -445,10 +445,10 @@
#assert o == cppyy.bind_object(cobj, o.__class__)
#assert o == cppyy.bind_object(cobj, "some_concrete_class")
assert cppyy.addressof(o) == cppyy.addressof(cppyy.bind_object(addr, some_concrete_class))
assert o == cppyy.bind_object(addr, some_concrete_class)
assert o == cppyy.bind_object(addr, type(o))
assert o == cppyy.bind_object(addr, o.__class__)
assert o == cppyy.bind_object(addr, "some_concrete_class")
assert o is cppyy.bind_object(addr, some_concrete_class)
assert o is cppyy.bind_object(addr, type(o))
assert o is cppyy.bind_object(addr, o.__class__)
assert o is cppyy.bind_object(addr, "some_concrete_class")
raises(TypeError, cppyy.bind_object, addr, "does_not_exist")
raises(TypeError, cppyy.bind_object, addr, 1)

Expand All @@ -466,18 +466,18 @@
assert o is o2

o3 = cppyy.bind_object(addr, some_class_with_data)
assert not o is o3

Check failure on line 469 in bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E714)

bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py:469:20: E714 Test for object identity should be `is not` help: Convert to `is not`

d1 = some_class_with_data()
d2 = d1.gime_copy()
assert not d1 is d2

Check failure on line 473 in bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E714)

bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py:473:20: E714 Test for object identity should be `is not` help: Convert to `is not`

dd1a = d1.gime_data()
dd1b = d1.gime_data()
assert dd1a is dd1b

dd2 = d2.gime_data()
assert not dd1a is dd2

Check failure on line 480 in bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E714)

bindings/pyroot/cppyy/cppyy/test/test_advancedcpp.py:480:20: E714 Test for object identity should be `is not` help: Convert to `is not`
assert not dd1b is dd2

d2.__destruct__()
Expand Down Expand Up @@ -531,13 +531,13 @@
b = base_class()
d = derived_class()

assert b == b.cycle(b)
assert b is b.cycle(b)
assert id(b) == id(b.cycle(b))
assert b == d.cycle(b)
assert b is d.cycle(b)
assert id(b) == id(d.cycle(b))
assert d == b.cycle(d)
assert d is b.cycle(d)
assert id(d) == id(b.cycle(d))
assert d == d.cycle(d)
assert d is d.cycle(d)
assert id(d) == id(d.cycle(d))

assert isinstance(b.cycle(b), base_class)
Expand Down
2 changes: 1 addition & 1 deletion bindings/pyroot/cppyy/cppyy/test/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def test09_global_ptr(self):

d = gbl.get_global_pod()
assert gbl.is_global_pod(d)
assert c == d
assert c is d
assert id(c) == id(d)

e = gbl.CppyyTestPod()
Expand Down
2 changes: 1 addition & 1 deletion bindings/pyroot/cppyy/cppyy/test/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def test11_cobject_addressing(self):
a = cppyy.gbl.CObjA()
co = cppyy.ll.as_cobject(a)

assert a == cppyy.bind_object(co, 'CObjA')
assert a is cppyy.bind_object(co, 'CObjA')
assert a.m_int == 42
assert cppyy.bind_object(co, 'CObjA').m_int == 42

Expand Down
2 changes: 1 addition & 1 deletion roottest/python/cpp/PyROOT_cpptests.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test12VoidPointerPassing( self ):
self.assertEqual( oaddr, Z.GimeAddressPtrRef( o ) )

pZ = Z.getZ(1)
self.assertEqual( pZ , Z.getZ(1) )
self.assertIs( pZ , Z.getZ(1) )

import array
# Not supported in p2.2
Expand Down
Loading