" Nose-compatible test name preparer " Maintainer: Sergey Matveev " License: GNU General Public License version 3 of the License or later " " When standing inside TestCase's test method, type t and full " Python (your.project.tests:TestCaseName.test_method_name) path will be " copied to clipboard ("*) register. function! python#testname#get() abort let l:pos = getpos(".") let l:postfix = matchstr(getline(search(".*\s*def .*[Tt]est", "b")), '\w\+(')[:-2] let l:postfix = matchstr(getline(search("^\s*class", "bn")), '\w\+(')[:-2] . "." . l:postfix call setpos(".", l:pos) let l:base = join([""] + split(getcwd(), "/")[:-1], "/") let l:prefix = substitute(expand("%:p:r")[len(l:base)+1:], "/", ".", "g") let l:name = l:prefix . ":" . l:postfix let @* = l:name echomsg l:name endfunction