[pygobject] test_import_machinery: be less strict with the import error message



commit fd7874ee7c5cb66cc552c90c6323db7dc4793e77
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sun Apr 1 11:45:12 2018 +0200

    test_import_machinery: be less strict with the import error message
    
    PyPy forwards our custom exception unlike python2.7

 tests/test_import_machinery.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/tests/test_import_machinery.py b/tests/test_import_machinery.py
index 27377cd6..9fbdd6e4 100644
--- a/tests/test_import_machinery.py
+++ b/tests/test_import_machinery.py
@@ -123,9 +123,7 @@ class TestImporter(unittest.TestCase):
         self.assertTrue('InvalidGObjectRepositoryModuleName' in exception_string)
 
         # 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:
+        if sys.version_info >= (3, 3):
             self.assertTrue('introspection typelib' in exception_string)
 
     def test_require_version_warning(self):


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