Error with the unittest on replit

I just started 2nd Project for Data Science using python Certification, and forked the initial boilerplate from repl.it.

Here is the snippet from one of the test

def test_higher_education_rich(self):
        actual = self.data['higher_education_rich']
        expected = 46.5
        self.assertAlmostEqual(actual, expected, "Expected different value for percentage with higher education that earn >50K.")

Third argument which is given as the positional argument(String for message if the test failed) is given as the positional argument.

below is self.assertAlmostEquals from Documentation

assertAlmostEqual( *first* , *second* , *places=7* , *msg=None* , *delta=None* )

As the third argument in function declaration is places, we’re just passing the string as it’s value and as a result, I’m having the errors such as following:

To fix this error, we just need to add the argument as msg="Expected different value for percentage...."

On github, only link to the boilerplate for the challenge is given. Should I just change the link to my edited repl and pull request for the change or There’s another method for that?

I’m not entirely sure what the typical process is, but there are repositories for each boilerplate code. In fact there’s already pull request for this issue with assertAlmostEqual - https://github.com/freeCodeCamp/boilerplate-demographic-data-analyzer/pull/2

I was unable to find this pull when I was searching for the similar issue, or pull request on github. Thank you for that…
Actually I was searching on the curriculum repo…

Thanks for the info…

1 Like