Data Analysis With Python Unittest Issue

Hi, regarding the unittest for the boilerplate-demographic-data-analyzer (2nd challenge in the Data Analysis with Python course) I ran into an issue.

In test_module.py the “expected” values that are sent to assertAlmostEqual() are rounded to 1 decimal place, but assertAlmostEqual() by default will check 7 decimal places.

This means that those who provide an answer accurate to 2 or more decimal places will potentially fail this test!

Nowhere in the Readme.md does it tell us to round to the nearest decimal place.

I suggest one of three options:

  1. Adjust the expected value(s) in test_module.py to be accurate up to 7 decimal places
  2. Send the places=1 parameter to AssertAlmostEquals()
  3. Edit Readme.md to instruct the student to round their answers to 1 decimal place.

Any thoughts?

There’s note in the README.md file to round to the nearest tenth.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.