Is test framework "unittests" Or "unittest" without the s

Notebook doesn’t recognize “unittests" . Google collab does.

The correct file name is ‘unittests.py’. It is provided in the assignment folder along with the ‘C1M3_Assignment.ipynb’ file.

it is accessed by the import unittests code here:

2 Likes

Thanks!

I should have checked earlier, but where exactly Do I find the .py file?

When I run the import cell, I get a message:

ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import unittests

ModuleNotFoundError: No module named ‘unittests’

why?

Sorry for the multiple post but I’m kind of new to this.

Are you running the lab on the Coursera platform, or are you trying to run it locally or on some other service?

Thanks for staying with me on this. I’m trying to run it on the Coursera platform.

See this image, I’ve added notations:

At ‘1’, this is the “File Explorer” tool. Click on it to see the files shown at ‘2’.

At ‘A’, you click in the cell and then press the ‘>’ (Run) button in the lab menu. This will run the code in that cell, and the select the next cell.
Press the Run button twice more and it will run the ‘2’ cell, where the unit test python file is imported.

Each cell will now have a number inside the set of square brackets, as shown here:

Thanks for your help! I had to refresh the workspace. Once I did the unittests.py appeared.

You were a great help. I certainly appreciate it.

1 Like