vendredi 16 septembre 2016

'module' object has no attribute 'py' when running from cmd

I'm currently learning unittesting, and I have stumbled upon a strange error: if I run my script from inside PyCharm, everything works perfectly. If I run it from my cmd.exe (as administrator), I get the following error : enter image description here

This is my code :`import unittest

class TutorialUnittest(unittest.TestCase):
    def test_add(self):
        self.assertEqual(23,23)
        self.assertNotEqual(11,12)

# function for raising errors.
def test_raise(self):
    with self.assertRaises(Exception):
        raise Exception`

Aucun commentaire:

Enregistrer un commentaire