diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-06-12 14:20:36 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-06-12 14:20:36 +0200 |
commit | 9f3685a527c9293b05c8ad7a6a4a7c2fa8b3b8b8 (patch) | |
tree | 4a01e3e62a1ecc504d835720319f0a26f71c041c /src/testdir | |
parent | 0ea4a6b94b6f7a13ef5027b43c36bda0836b51af (diff) |
updated for version 7.3.1172v7.3.1172
Problem: Python 2: loading modules doesn't work well.
Solution: Fix the code. Add more tests. (ZyX)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/python2/module.py | 1 | ||||
-rw-r--r-- | src/testdir/python3/module.py | 1 | ||||
-rw-r--r-- | src/testdir/python_after/after.py | 2 | ||||
-rw-r--r-- | src/testdir/python_before/before.py | 1 | ||||
-rw-r--r-- | src/testdir/test86.in | 7 | ||||
-rw-r--r-- | src/testdir/test86.ok | 2 | ||||
-rw-r--r-- | src/testdir/test87.in | 7 | ||||
-rw-r--r-- | src/testdir/test87.ok | 2 |
8 files changed, 23 insertions, 0 deletions
diff --git a/src/testdir/python2/module.py b/src/testdir/python2/module.py index 5f0a6f0a9f..e90106ab2a 100644 --- a/src/testdir/python2/module.py +++ b/src/testdir/python2/module.py @@ -1 +1,2 @@ +import before_1 dir = '2' diff --git a/src/testdir/python3/module.py b/src/testdir/python3/module.py index 1ccfb094c0..24bd036e1d 100644 --- a/src/testdir/python3/module.py +++ b/src/testdir/python3/module.py @@ -1 +1,2 @@ +import before_1 dir = '3' diff --git a/src/testdir/python_after/after.py b/src/testdir/python_after/after.py new file mode 100644 index 0000000000..5cf8fa46c3 --- /dev/null +++ b/src/testdir/python_after/after.py @@ -0,0 +1,2 @@ +import before_2 +dir = "after" diff --git a/src/testdir/python_before/before.py b/src/testdir/python_before/before.py new file mode 100644 index 0000000000..531e81a972 --- /dev/null +++ b/src/testdir/python_before/before.py @@ -0,0 +1 @@ +dir = "before" diff --git a/src/testdir/test86.in b/src/testdir/test86.in index 26c7fe2178..e22ae31039 100644 --- a/src/testdir/test86.in +++ b/src/testdir/test86.in @@ -8,6 +8,7 @@ See http://svn.python.org/view/python/trunk/Misc/README.valgrind?view=markup STARTTEST :so small.vim :set encoding=latin1 +:set noswapfile :if !has('python') | e! test.ok | wq! test.out | endif :lang C :py import vim @@ -1071,10 +1072,16 @@ EOF :" :" Test import py << EOF +sys.path.insert(0, os.path.join(os.getcwd(), 'python_before')) +sys.path.append(os.path.join(os.getcwd(), 'python_after')) vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') from module import dir as d from modulex import ddir cb.append(d + ',' + ddir) +import before +cb.append(before.dir) +import after +cb.append(after.dir) EOF :" :" Test exceptions diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok index 145979ff53..e981544f02 100644 --- a/src/testdir/test86.ok +++ b/src/testdir/test86.ok @@ -1084,6 +1084,8 @@ vim.current.window = True:(<type 'exceptions.TypeError'>, TypeError('expected vi vim.current.tabpage = True:(<type 'exceptions.TypeError'>, TypeError('expected vim.TabPage object',)) vim.current.xxx = True:(<type 'exceptions.AttributeError'>, AttributeError('xxx',)) 2,xx +before +after vim.command("throw 'abc'"):(<class 'vim.error'>, error('abc',)) Exe("throw 'def'"):(<class 'vim.error'>, error('def',)) vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',)) diff --git a/src/testdir/test87.in b/src/testdir/test87.in index 7a3d583590..1223ca96aa 100644 --- a/src/testdir/test87.in +++ b/src/testdir/test87.in @@ -2,6 +2,7 @@ Tests for various python features. vim: set ft=vim : STARTTEST :so small.vim +:set noswapfile :if !has('python3') | e! test.ok | wq! test.out | endif :lang C :py3 import vim @@ -1038,10 +1039,16 @@ EOF :" :" Test import py3 << EOF +sys.path.insert(0, os.path.join(os.getcwd(), 'python_before')) +sys.path.append(os.path.join(os.getcwd(), 'python_after')) vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') from module import dir as d from modulex import ddir cb.append(d + ',' + ddir) +import before +cb.append(before.dir) +import after +cb.append(after.dir) EOF :" :" Test exceptions diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok index 31c7df4b66..1d4044519d 100644 --- a/src/testdir/test87.ok +++ b/src/testdir/test87.ok @@ -1093,6 +1093,8 @@ vim.current.window = True:(<class 'TypeError'>, TypeError('expected vim.Window o vim.current.tabpage = True:(<class 'TypeError'>, TypeError('expected vim.TabPage object',)) vim.current.xxx = True:(<class 'AttributeError'>, AttributeError('xxx',)) 3,xx +before +after vim.command("throw 'abc'"):(<class 'vim.error'>, error('abc',)) Exe("throw 'def'"):(<class 'vim.error'>, error('def',)) vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',)) |