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 686627 - TestSource.testSources() test does not clean up its GSources
TestSource.testSources() test does not clean up its GSources
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks: 686443
 
 
Reported: 2012-10-22 11:43 UTC by Martin Pitt
Modified: 2012-10-23 03:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix TestSource.testSources() test case (1.54 KB, patch)
2012-10-22 11:45 UTC, Martin Pitt
none Details | Review

Description Martin Pitt 2012-10-22 11:43:25 UTC
PyGObject has established the assumption that the destruction of a GLib.Source Python object does not destroy the actual GSource, as shown in TestSource.setup_timeout(), TestTimeout.test504337(), and https://bugzilla.gnome.org/show_bug.cgi?id=504337.

So we need to explicitly destroy our MySource and Idle objects after using 
them, as their callbacks always return True and we do not want them to spill over into other tests.

Also, that test has a bad bug:

        assert self.pos >= 0 and idle.count >= 0

This does not actually assert anything. We need to compare self.pos to > 0, as we want to enforce that MySources' callback was called at least once.
Comment 1 Martin Pitt 2012-10-22 11:45:15 UTC
Created attachment 226980 [details] [review]
Fix TestSource.testSources() test case

This fixes the problem.
Comment 2 Martin Pitt 2012-10-23 03:52:45 UTC
I pushed this.