Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 3, Exercise 3 self.assertEqual() error #262

Open
michaelalangill opened this issue Feb 9, 2023 · 1 comment
Open

Chapter 3, Exercise 3 self.assertEqual() error #262

michaelalangill opened this issue Feb 9, 2023 · 1 comment

Comments

@michaelalangill
Copy link

When saving the ecc.py file with the code given in the "answers" file for this exercise, I get a "NotImplementedError". When I adjust the code to say return p1+p2==p3, the test passes. The exercise is to make the test pass, which I was able to do without looking at the answers. That said, when I checked myself, I thought the answer looked better (especially considering that delicious self.assertEqual()). Mine works, the 'answer' doesn't. Why?

@aniketambore
Copy link

The reason for encountering a NotImplementedError is likely due to either not removing the raise NotImplementedError line from the test_add method in the ECCTest class, or because your python interpreter session is still using an outdated version of the code even after you have made changes and saved the updated file.

To resolve the issue, ensure that you have properly removed the mentioned line, or restart the python interpreter session to run the test without errors.

The testcase will pass without any error as expected.

>>> import ecc                   
>>> from helper import run
>>> run(ecc.ECCTest('test_add'))
.
----------------------------------------------------------------------
Ran 1 test in 0.000s

OK
>>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants