Skip to content

Commit

Permalink
Throw exceptions instead of warnings when running tests (see #29).
Browse files Browse the repository at this point in the history
This will allow us to be notified by the build bots, so that the warnings can be fixed.
  • Loading branch information
iMichka committed Feb 16, 2016
1 parent 6261ef8 commit 4e1e497
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions unittests/autoconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import sys
import logging
import warnings

this_module_dir_path = os.path.abspath(
os.path.dirname(sys.modules[__name__].__file__))
Expand All @@ -23,6 +24,11 @@
import pygccxml.parser # nopep8
import pygccxml.utils # nopep8

# We want to make sure we throw an error for ALL the warnings during the
# tests. This will allow us to be notified by the build bots, so that the
# warnings can be fixed.
warnings.simplefilter("error", Warning)

# Set logging level
pygccxml.utils.loggers.set_level(logging.INFO)

Expand Down
2 changes: 1 addition & 1 deletion unittests/core_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_compiler_retrocompatibility(self):
self.assertIn("CastXML", std.compiler)

# Reset this warning to always
warnings.simplefilter("always", DeprecationWarning)
warnings.simplefilter("error", DeprecationWarning)

def test_mangled_name_namespace(self):
std = self.global_ns.namespace("std")
Expand Down

0 comments on commit 4e1e497

Please sign in to comment.