[yt-svn] commit/yt: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Oct 17 14:18:09 PDT 2016


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/528b935fca7f/
Changeset:   528b935fca7f
Branch:      yt
User:        ngoldbaum
Date:        2016-09-15 01:32:50+00:00
Summary:     fix mock import in Python3, stub test_config if mock isn't installed in Python2
Affected #:  1 file

diff -r c7b7950bb650eadad20134c09cadb837ed9d9063 -r 528b935fca7fb0052722b09bcb7e5ecae3f32de3 yt/utilities/tests/test_config.py
--- a/yt/utilities/tests/test_config.py
+++ b/yt/utilities/tests/test_config.py
@@ -8,9 +8,15 @@
 #-----------------------------------------------------------------------------
 
 import contextlib
-import mock
 import os
 import sys
+if sys.version_info.major < 3:
+    try:
+        import mock
+    except ImportError:
+        mock = None
+else:
+    import unittest.mock as mock
 import unittest
 import yt.utilities.command_line
 import yt.config
@@ -79,6 +85,10 @@
 
 class TestYTConfigCommands(TestYTConfig):
     def testConfigCommands(self):
+        # stub out test if mock isn't installed in Python2
+        if mock is None:
+            return
+
         self.assertFalse(os.path.exists(CURRENT_CONFIG_FILE))
 
         info = self._runYTConfig(['--help'])


https://bitbucket.org/yt_analysis/yt/commits/3c5bbf6a2e85/
Changeset:   3c5bbf6a2e85
Branch:      yt
User:        ngoldbaum
Date:        2016-10-17 21:17:41+00:00
Summary:     Merged in ngoldbaum/yt (pull request #2377)

fix mock import in Python3, stub test_config if mock isn't installed in Python2
Affected #:  1 file

diff -r c9222c0a700487f6e088bcaa1b63027b0c83bfa4 -r 3c5bbf6a2e8555dc82f728961a8163ac16547f56 yt/utilities/tests/test_config.py
--- a/yt/utilities/tests/test_config.py
+++ b/yt/utilities/tests/test_config.py
@@ -8,9 +8,15 @@
 #-----------------------------------------------------------------------------
 
 import contextlib
-import mock
 import os
 import sys
+if sys.version_info.major < 3:
+    try:
+        import mock
+    except ImportError:
+        mock = None
+else:
+    import unittest.mock as mock
 import unittest
 import yt.utilities.command_line
 import yt.config
@@ -79,6 +85,10 @@
 
 class TestYTConfigCommands(TestYTConfig):
     def testConfigCommands(self):
+        # stub out test if mock isn't installed in Python2
+        if mock is None:
+            return
+
         self.assertFalse(os.path.exists(CURRENT_CONFIG_FILE))
 
         info = self._runYTConfig(['--help'])

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list