Created
May 24, 2016 21:03
-
-
Save purpleP/f8797893e68af6b8c6c7573078a33d6b to your computer and use it in GitHub Desktop.
some python snippets for ultisnip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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