Skip to content

Instantly share code, notes, and snippets.

I have a dataframe like this:
name vals
0 foo X
1 foo Y
2 foo Z
3 bar Y
4 bar Z
5 bar Q
BLASTX 2.7.1+
Reference: Stephen F. Altschul, Thomas L. Madden, Alejandro A.
Schaffer, Jinghui Zhang, Zheng Zhang, Webb Miller, and David J.
Lipman (1997), "Gapped BLAST and PSI-BLAST: a new generation of
protein database search programs", Nucleic Acids Res. 25:3389-3402.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
def hello(name):
return "Happy testing! "+name
def hello(name):
return "Happy testing! ",name
def hello(name):
pass
def hello():
pass
E
======================================================================
ERROR: test_hello (__main__.MyTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "mytests.py", line 7, in test_hello
self.assertEqual(hello('John'), 'Happy testing! John')
NameError: name 'hello' is not defined
----------------------------------------------------------------------
import unittest
from mycodes import *
class MyTests(unittest.TestCase):
##your playground starts
def test_hello(self):
self.assertEqual(hello('John'), 'Happy testing! John')
##your playground ends
if __name__=="__main__":
import unittest
from mycodes import *
class MyTests(unittest.TestCase):
##your playground starts
def yourtest(self):
pass
##your playground ends
if __name__=="__main__":