W1A3: nbgrader-part fails 60/100 with "Tests failed on 1 cell(s)!"

When I submit the assignment for grading, I get 60/100, and also:

[ValidateApp | INFO] Validating '/home/jovyan/work/submitted/courseraLearner/W1A3/Gradient_Checking.ipynb'
[ValidateApp | INFO] Executing notebook with kernel: python3
Tests failed on 1 cell(s)! These tests could be hidden. Please check your submission.

I have tried everything:

  • all tests pass - I get expected output
  • reset lab files
  • stuff in the link below:

Here’s another thread that describes an error on that assignment that produces that behavior. Definitely worth a look. The overall point is that you don’t need to do any type coercion on the difference value that you are computing.

Thankyou!

That was the problem. I had two lines like so:

difference = float(numerator / denominator)

The solution was to remove the type casting:

difference = numerator / denominator  # NOTE: was float(...)

I am grateful for your help - I was tearing my hair out!


TBH, I see this as a bug - the assignment should not fail simply because I am choosing to implement what some people may consider to be best practice a la PEP484 and type checking.

I also do not recall any warning about this elsewhere, and there were no hints to be had in the cell below.

1 Like

Yes, I agree that the tests in the notebook should fail in a transparent way in that case. Well, either that or they should change the grader to accept your version of the code. I have filed an enhancement request about this, but the course staff has not yet had a chance to fix it. Sorry for the inconvenience!