Add support for copying references to use with nose by gherceg · Pull Request #5 · ranelpadon/python-copy-reference.vim · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions autoload/python_copy_reference.vim
1 change: 1 addition & 0 deletions plugin/python-copy-reference.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ let g:loaded_python_copy_reference = 1
command! -nargs=0 PythonCopyReferenceDotted call python_copy_reference#dotted()
command! -nargs=0 PythonCopyReferencePytest call python_copy_reference#pytest()
command! -nargs=0 PythonCopyReferenceImport call python_copy_reference#import()
command! -nargs=0 PythonCopyReferenceNose call python_copy_reference#nose()
30 changes: 30 additions & 0 deletions test/nose.vader
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Do (copy reference):
:e! some/package/path.py\<cr>
:let g:python_copy_reference = {}\<cr>
:call python_copy_reference#nose()\<cr>

Do (paste reference):
"+p

Expect:
some.package.path

Do (clean up):
let @+ = ''
:%bd!\<cr>

Do (copy reference with attributes):
:e! some/package/path.py\<cr>
idef SomeClass():\<cr> def some_function():\<cr> pass\<esc>
k
:let g:python_copy_reference = {}\<cr>
:call python_copy_reference#nose()\<cr>

Do (paste reference):
"+p

Expect:
some.package.path:SomeClass.some_function

Do (clean up):
:%bd!\<cr>
16 changes: 16 additions & 0 deletions test/pytest.vader