[gtk-doc] common: drop python2 support from test



commit 94dddeb02f300cbaa3e946be63ec123c6eb99595
Author: Stefan Sauer <ensonic users sf net>
Date:   Tue Nov 20 19:36:03 2018 +0100

    common: drop python2 support from test

 tests/common.py | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
---
diff --git a/tests/common.py b/tests/common.py
index 26dd16b..20b1558 100755
--- a/tests/common.py
+++ b/tests/common.py
@@ -18,23 +18,12 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 
-try:
-    from unittest import mock
-except ImportError:
-    import mock
-
+from unittest import mock
 import unittest
 
-from six import PY2
 from gtkdoc import common
 
 
-if PY2:
-    openname = '__builtin__.open'
-else:
-    openname = 'builtins.open'
-
-
 class TestUpdateFileIfChanged(unittest.TestCase):
 
     @mock.patch('os.path.exists')
@@ -46,7 +35,7 @@ class TestUpdateFileIfChanged(unittest.TestCase):
         self.assertTrue(res)
 
     @mock.patch('os.path.exists')
-    @mock.patch(openname, mock.mock_open(read_data='bar'))
+    @mock.patch('builtins.open', mock.mock_open(read_data='bar'))
     @mock.patch('os.unlink')
     def test_FilesAreTheSame(self, os_unlink, os_path_exists):
         os_path_exists.return_value = True


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