Author: Ronan Lamy <[email protected]>
Branch: py3k
Changeset: r87344:6ff2d69f043f
Date: 2016-09-23 17:19 +0100
http://bitbucket.org/pypy/pypy/changeset/6ff2d69f043f/

Log:    Fix test_load_dynamic() to match CPython behaviour

diff --git a/pypy/module/imp/test/test_app.py b/pypy/module/imp/test/test_app.py
--- a/pypy/module/imp/test/test_app.py
+++ b/pypy/module/imp/test/test_app.py
@@ -54,11 +54,14 @@
         finally:
             del sys.path[0]
 
-    def test_load_dynamic(self):
-        import imp
-        raises(ImportError, imp.load_dynamic, 'foo', 'bar')
-        raises(ImportError, imp.load_dynamic, 'foo', 'bar',
-               open(self.file_module))
+    def test_load_dynamic_error(self):
+        import _imp
+        excinfo = raises(ImportError, _imp.load_dynamic, 'foo', 'bar')
+        assert excinfo.value.name == 'foo'
+        assert 'bar' in excinfo.value.path
+        # Note: On CPython, the behavior changes slightly if a 3rd argument is
+        # passed in, whose value is ignored. We don't implement that.
+        #raises(IOError, _imp.load_dynamic, 'foo', 'bar', 42)
 
     def test_suffixes(self):
         import imp
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to