0

My code works on mobile but doesn't work on my laptop!!!

Hello. When I run this on my mobile it returns: Ran 2 tests FAILED But on my laptop it returns: Ran 0 tests OK Why???? tnx for your help #first script def firstfunc(word): return word.capitalize() #second import unittest import myscript class learntest(unittest.TestCase): def testfunc1(self): result = myscript.firstfunc('hello') self.assertEqual(result,'Hello') def testfunc2(self): result = myscript.firstfunc('hello world') self.assertEqual(result,'Hello World') if __name__ == '__main__': unittest.main()

19th Jun 2021, 2:11 PM
rejebali
rejebali - avatar
2 Antworten
0
maybe it has to do with your compiler
19th Jun 2021, 9:53 PM
Danny
Danny - avatar
0
the only reason i can think of is that you dont have the “myscript” module in the right location on your laptop, or its not on your laptop at all. you will need the python file “myscript.py” with your functions in the same directory you are running your python code. i hope that is helpful.
20th Jun 2021, 2:52 AM
you are smart. you are brave.
you are smart. you are brave. - avatar