Unit test passed but No module named 'unittests' error in assignment submission


Hello All,
This is related to Graph assignment submission in Course 1 , Week 3. My unit test case are passed. However, grading fails with error “No module named ‘unittests’” for all test cases. I have tried restarting and running kernel, deleting old lab files and get new file using get latest version but still error occurs when assignment is graded. Screenshot attached. Any help will be appreciated.

Thanks,
Pradeep

Did you perhaps delete, move or modify Cell 2 from the notebook, or modify some of the notebook metadata (even by accident)?

The grader relies on some metadata to know which cells to use in grading your assignment. If the cell that imports the unittests is mis-marked, then the grader won’t run that cell, and the package isn’t imported.

Hi TMosh,
Thanks for your response. I just added code for each method and no other cell including cell 2 was edited or removed.

Thanks,
Pradeep

Hmm, maybe you have deleted the unittests.py file by mistake? If so, perform a “Get the Latest Verson” of the Lab!

I got the same error when import unittests to Graph_Advanced for test locally.
Solution: before submit just remove that import statement and submit again.

1 Like