Skip to content

Instantly share code, notes, and snippets.

@MrOrz
Created March 1, 2015 17:32
Show Gist options
  • Save MrOrz/efa7f665365d12b6f770 to your computer and use it in GitHub Desktop.
Save MrOrz/efa7f665365d12b6f770 to your computer and use it in GitHub Desktop.
import unittest
import 你要測的東西
class XxxSpec(unittest.TestCase):
def setUp(self):
"""
每個 test 前都會執行的東西。你可以塞一些常用的東西進 self。
"""
pass
def test_aaaaaaaaa(self):
"""
會被跑的測資 1
"""
pass
def test_bbbbbbbbb(self):
"""
會被跑的測資 2
"""
pass
def tearDown(self):
"""
每次剛跑完一個 code 都會做的事情。我一直都是寫 pass
"""
pass
if __name__ == '__main__':
unittest.main()
## 直接打 python xxxSpec.py 就會跑囉
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment