GNOME Bugzilla – Bug 740301
test_docstring.Test.test_may_return_none() fails with glib <2.42 and gobject-introspection <1.42
Last modified: 2016-06-07 08:06:04 UTC
test_docstring.Test.test_may_return_none() fails in the same way with each version of Python (2.7, 3.1, 3.2, 3.3, 3.4). This test was introduced in pygobject-3.14.0 and is absent in pygobject-3.12.2. Output with Python 3.4: ====================================================================== FAIL: test_may_return_none (test_docstring.Test) ---------------------------------------------------------------------- Traceback (most recent call last):
+ Trace 234339
'get_basename(self) -> str or None')
- get_basename(self) -> str + get_basename(self) -> str or None ? ++++++++ ---------------------------------------------------------------------- Ran 1121 tests in 16.576s FAILED (failures=1, skipped=5, expected failures=12)
This failure is present when using glib 2.40.* and gobject-introspection 1.40.*. This failure is absent when using glib 2.42.* and gobject-introspection 1.42.*.
This is probably a combination of glib growing support for nullable arguments along with docstring fixes on the pygobject side of things. I suggest adding something like this to the test case if you want it to pass for more versions: @unittest.skipUnless((GLib.MAJOR_VERSION, GLib.MINOR_VERSION) >= (2, 42))
A simpler variant: @unittest.skipIf(GLib.glib_version < (2, 42))
Created attachment 329220 [details] [review] Skip a test with older glib