From: David Shea dshea@redhat.com
--- Makefile | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/Makefile b/Makefile index d9b633e..c264b45 100644 --- a/Makefile +++ b/Makefile @@ -6,3 +6,6 @@ all: check: PYTHONPATH=. tests/pylint/runpylint.py python3 -m unittest discover tests/unittests + +ci: + $(MAKE) check
From 45245ebebd1c2922bc3faaf0395c097e235d15f6 Mon Sep 17 00:00:00 2001 From: David Shea dshea@redhat.com Date: Tue, 1 Dec 2015 16:34:14 -0500 Subject: [PATCH 2/2] Fix the tests for test_percentage.
Ignore DeprecationWarnings so that the deprecation warning from polib doesn't get in the way of the test, and actually call test_percentage in test_not_ok. --- tests/unittests/test_translated.py | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tests/unittests/test_translated.py b/tests/unittests/test_translated.py index 7011cb7..2f90634 100644 --- a/tests/unittests/test_translated.py +++ b/tests/unittests/test_translated.py @@ -77,7 +77,11 @@ def setUp(self): self.tmpdir = tempfile.mkdtemp() self.popath = os.path.join(self.tmpdir, "test.po") self.mopath = os.path.join(self.tmpdir, "test.mo") + + # Convert warnings into exceptions to make them easier to test for warnings.simplefilter("error") + # polib throws a DeprecationWarnings so ignore that + warnings.simplefilter("default", DeprecationWarning)
def tearDown(self): shutil.rmtree(self.tmpdir) @@ -98,6 +102,8 @@ def test_not_ok(self): pofile.save(self.popath) pofile.save_as_mofile(self.mopath)
+ self.assertRaises(Warning, test_percentage, self.mopath) + class TestUsability(unittest.TestCase): def test_ok(self): # what lt's Plural-Forms is supposed to look like
anaconda-patches@lists.fedorahosted.org