Skip to content

Instantly share code, notes, and snippets.

@purpleP
Created May 24, 2016
Embed
What would you like to do?
some python snippets for ultisnip
snippet fixture "pytest fixture" b
@pytest.fixture(${1})
def ${2}(${3}):
${4}
endsnippet
snippet parametrize "pytest parametrize test" b
@pytest.mark.parametrize(${1:''}, ${2:()})
def ${3}(${4}):
${5}
endsnippet
snippet de "Python function" b
def ${1:name}(${2:params}):
${3:pass}
`!p
import re
t[1] = t[1].replace(' ', '_')
t[2] = re.sub('([^,])(\s+)', r'\1_', t[2])
`
endsnippet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment