[pygobject] Fix a test with Python 3.1/3.2



commit a12f7027adeb57fe1c0142c86d34d5ec8f6b6d9e
Author: Christoph Reiter <creiter src gnome org>
Date:   Mon Jun 6 20:13:29 2016 +0200

    Fix a test with Python 3.1/3.2
    
    Fix Python version check in
    TestImporter.test_invalid_repository_module_name()
    to avoid failure with Python 3.1 and 3.2.
    
    Fix provided by Arfrever Frehtes Taifersar Arahesis at
       https://bugzilla.gnome.org/show_bug.cgi?id=740324#c1
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740324

 tests/test_import_machinery.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tests/test_import_machinery.py b/tests/test_import_machinery.py
index 8cc37cb..dac48af 100644
--- a/tests/test_import_machinery.py
+++ b/tests/test_import_machinery.py
@@ -125,8 +125,8 @@ class TestImporter(unittest.TestCase):
 
         self.assertTrue('InvalidGObjectRepositoryModuleName' in exception_string)
 
-        # The message of the custom exception in gi/importer.py is eaten in Python 2.7
-        if sys.version_info.major < 3:
+        # The message of the custom exception in gi/importer.py is eaten in Python <3.3
+        if sys.version_info < (3, 3):
             self.assertTrue('introspection typelib' not in exception_string)
         else:
             self.assertTrue('introspection typelib' in exception_string)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]