nnoremap <C-p> :!python %<CR>
unittest
import unittest
#(Omission)
if __name__ == '__main__':
unittest.main()
Tests
class PythonTest(unittest.TestCase):
def test_zero(self):
self.assertEqual(0, 0)
def test_foo(self):
self.assertEqual("foo", "foo")
def test_bar(self):
self.assertEqual("foo", "foo")
sample
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'Functions for evaluation'
def evaluate(value):
"""Function to return as is"""
return value
import unittest
class EvaluateTest(unittest.TestCase):
def test_evaluate(self):
value = 1
evaluated_value = evaluate(value)
self.assertEqual(value,evaluated_value)
if __name__ == '__main__':
unittest.main()
Recommended Posts