Skip to content

Instantly share code, notes, and snippets.

@sinistamunkey
Last active April 19, 2021 13:32
Show Gist options
  • Save sinistamunkey/5e69e658c2fb15d52566a137ea6b74ff to your computer and use it in GitHub Desktop.
Save sinistamunkey/5e69e658c2fb15d52566a137ea6b74ff to your computer and use it in GitHub Desktop.
VSCode snippets - Python
{
"test_case": {
"prefix": "test_case",
"body": [
"class Test${1:class_name}(object):",
"",
" def test_${2:does_thing}(self):",
" assert False"
],
"description": "Creates a stub test case"
},
"test": {
"prefix": "test",
"body": [
"def test_${1:does_thing}(self):",
" assert False"
],
"description": "Creates a new test scenario"
},
"patch": {
"prefix": "patch",
"body": [
"${1:object}_patch = patch('${2:module}.${1:object}')",
"self.${1:object} = ${1:object}_patch.start()",
"self.addCleanup(${1:object}_patch.stop)"
],
"description": "Creates a new patch and sets a class based mock"
},
"property": {
"prefix": "prop",
"body": [
"_${1:name} = None",
"@property",
"def ${1:name}(self):",
" return self._${1:name}"
],
"description": "Creates a new read only property"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment