summaryrefslogtreecommitdiff
path: root/tests/test_overrides_gobject.py
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-11-25 13:13:38 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-11-25 13:13:38 +0100
commit62b16247b9230a975d85e749da9f1b199fbc3c84 (patch)
tree650244bd48e940d8bc3a102170ed0f660a4ca126 /tests/test_overrides_gobject.py
parenteea9716a8351dead3bdcdb8a20bbf8d94f132249 (diff)
downloadpygobject-62b16247b9230a975d85e749da9f1b199fbc3c84.tar.gz
GValue.get_value: fix crashes for Variants
g_value_get_variant is transfer-none but was annotated as full which results in the bindings unreffing it too many times. Work around the issue by using g_value_dup_variant instead which is really transfer-full.
Diffstat (limited to 'tests/test_overrides_gobject.py')
-rw-r--r--tests/test_overrides_gobject.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_overrides_gobject.py b/tests/test_overrides_gobject.py
index b902564f..37292dbb 100644
--- a/tests/test_overrides_gobject.py
+++ b/tests/test_overrides_gobject.py
@@ -183,13 +183,14 @@ def test_value_variant():
assert v.get_value() is None
variant = GLib.Variant('i', 42)
v.set_value(variant)
-
- # FIXME: triggers an assert
- # assert v.get_value() == variant
+ assert v.get_value() == variant
v.set_value(None)
assert v.get_value() is None
+ with pytest.raises(TypeError):
+ v.set_value(object())
+
def test_value_param():
# FIXME: set_value and get_value trigger a critical