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 751156 - Silence various build and test warnings
Silence various build and test warnings
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:
 
 
Reported: 2015-06-18 12:33 UTC by Christoph Reiter (lazka)
Modified: 2015-07-02 18:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix gcc warning regarding uninitialized use of variable (1.06 KB, patch)
2015-06-18 12:34 UTC, Christoph Reiter (lazka)
committed Details | Review
tests: Silence various error messages and warnings. (28.36 KB, patch)
2015-06-18 12:35 UTC, Christoph Reiter (lazka)
none Details | Review
tests: Silence various error messages and warnings. (28.32 KB, patch)
2015-07-02 15:37 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Christoph Reiter (lazka) 2015-06-18 12:33:28 UTC
The build and test process is getting quite noisy with current jhbuild trunk, so here are some patches to improve this situation.

Related issues in other projects: bug 751140 and bug 751150
Comment 1 Christoph Reiter (lazka) 2015-06-18 12:34:36 UTC
Created attachment 305557 [details] [review]
Fix gcc warning regarding uninitialized use of variable

Fix gcc warning regarding uninitialized use of variable
Comment 2 Christoph Reiter (lazka) 2015-06-18 12:35:20 UTC
Created attachment 305558 [details] [review]
tests: Silence various error messages and warnings.

This silences glib warnings which are due to testing
of error handling, deprecation warnings which we ignore
since we want to continue testing deprecated code and
other error output of code which is supposed to fail.

To reduce code duplication and make things easier
this introduces a shared helper module containing
various context managers and decorators which allow
testing and silencing of warnings and errors.
Comment 3 Simon Feltman 2015-07-01 07:08:46 UTC
Review of attachment 305558 [details] [review]:

Looks good overall, just a few nitpicks.

::: tests/helper.py
@@ +19,3 @@
+
+@contextlib.contextmanager
+def capture_exceptions():

We might want to think about using this in test_generictreemodel.py [1] in the future. Your implementation is simpler which I like.

[1] https://git.gnome.org/browse/pygobject/tree/tests/test_generictreemodel.py?id=3.16.2#n316

@@ +37,3 @@
+
+
+def test_ignore_gi_deprecation_warnings(func_or_class):

I don't really like the "test_" prefix here. What about just naming it ignore_gi_deprecation_warnings() ?

::: tests/test_everything.py
@@ +628,3 @@
         # through from the callback, as it crosses the Python<->C boundary
         # twice. (See GNOME #616279)
+        with capture_exceptions() as esc:

Any reason this is named "esc" instead of "exc" as used elsewhere in your patch?
Comment 4 Simon Feltman 2015-07-01 07:09:02 UTC
Review of attachment 305557 [details] [review]:

Sure.
Comment 5 Christoph Reiter (lazka) 2015-07-02 15:36:50 UTC
(In reply to Simon Feltman from comment #3)
> Review of attachment 305558 [details] [review] [review]:
> 
> Looks good overall, just a few nitpicks.
> 
> ::: tests/helper.py
> @@ +19,3 @@
> +
> +@contextlib.contextmanager
> +def capture_exceptions():
> 
> We might want to think about using this in test_generictreemodel.py [1] in
> the future. Your implementation is simpler which I like.
> 
> [1]
> https://git.gnome.org/browse/pygobject/tree/tests/test_generictreemodel.
> py?id=3.16.2#n316

Sounds good. (I didn't include this in the updated patch)

> @@ +37,3 @@
> +
> +
> +def test_ignore_gi_deprecation_warnings(func_or_class):
> 
> I don't really like the "test_" prefix here. What about just naming it
> ignore_gi_deprecation_warnings() ?

OK

> ::: tests/test_everything.py
> @@ +628,3 @@
>          # through from the callback, as it crosses the Python<->C boundary
>          # twice. (See GNOME #616279)
> +        with capture_exceptions() as esc:
> 
> Any reason this is named "esc" instead of "exc" as used elsewhere in your
> patch?

No, just a typo/thinko.
Comment 6 Christoph Reiter (lazka) 2015-07-02 15:37:17 UTC
Created attachment 306645 [details] [review]
tests: Silence various error messages and warnings.
Comment 7 Simon Feltman 2015-07-02 17:10:06 UTC
Review of attachment 306645 [details] [review]:

Unittest output is a lot cleaner now, thanks!