After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740301 - test_docstring.Test.test_may_return_none() fails with glib <2.42 and gobject-introspection <1.42
test_docstring.Test.test_may_return_none() fails with glib <2.42 and gobject-...
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-18 10:54 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2016-06-07 08:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Skip a test with older glib (1.21 KB, patch)
2016-06-06 18:09 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Arfrever Frehtes Taifersar Arahesis 2014-11-18 10:54:20 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):
  • File "/tmp/pygobject-3.14.0/tests/test_docstring.py", line 68 in test_may_return_none
    'get_basename(self) -> str or None')
AssertionError: 'get_basename(self) -> str' != '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)
Comment 1 Arfrever Frehtes Taifersar Arahesis 2014-11-18 15:59:06 UTC
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.*.
Comment 2 Simon Feltman 2014-11-19 03:42:41 UTC
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))
Comment 3 Arfrever Frehtes Taifersar Arahesis 2014-11-19 06:42:04 UTC
A simpler variant:
@unittest.skipIf(GLib.glib_version < (2, 42))
Comment 4 Christoph Reiter (lazka) 2016-06-06 18:09:43 UTC
Created attachment 329220 [details] [review]
Skip a test with older glib