[pygobject] tests: Set the active style context state before retrieving values
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] tests: Set the active style context state before retrieving values
- Date: Sun, 21 Feb 2016 03:56:43 +0000 (UTC)
commit 0467808b97f89c5a36c01f5b7cba013acaef6851
Author: Simon Feltman <sfeltman src gnome org>
Date: Sat Feb 20 19:40:45 2016 -0800
tests: Set the active style context state before retrieving values
compat_test_pygtk.TestGTKCompat.test_style() was giving a warning due
to set/get state mismatch. Set the current state before getting values
from the context.
tests/compat_test_pygtk.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/tests/compat_test_pygtk.py b/tests/compat_test_pygtk.py
index dbe3c9a..71b1c06 100644
--- a/tests/compat_test_pygtk.py
+++ b/tests/compat_test_pygtk.py
@@ -73,6 +73,7 @@ class TestGTKCompat(unittest.TestCase):
def test_style(self):
widget = gtk.Button()
with capture_gi_deprecation_warnings():
+ widget.get_style_context().set_state(gtk.STATE_NORMAL)
self.assertTrue(isinstance(widget.style.base[gtk.STATE_NORMAL],
gtk.gdk.Color))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]