Lesson6: AttributeError: 'NoneType' object has no attribute '_with_attr' #295
-
Hi, I am getting this error while executing test_fund_me.py when running Since I couldn't solve it, I decided to clone the lesson's repo to get the exact same source code, and to my surprise, I still got the same error. Maybe there is something wrong with my setup, please help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hello @jamsubzero I just cloned the repo and ran the test, which went fine as you can see bellow, this is estrange as is the exact same code but anyways I have some hints that could be handy.
Attached Image (test running fine) |
Beta Was this translation helpful? Give feedback.
-
I've got the same problem.
After I did some research in this discussion forum, I tried reinstall ganache-cli as follows. uninstall ganache-cli
reinstall ganache-cli
test again And it worked.
There are node_modules/ and package-lock.json appear on brownie_fund_me project path. |
Beta Was this translation helpful? Give feedback.
Hello @jamsubzero I just cloned the repo and ran the test, which went fine as you can see bellow, this is estrange as is the exact same code but anyways I have some hints that could be handy.
brownie test -s -k test_only_owner_can_withdraw
and paste here the result.NoneType
means that instead of an instance of a Class, Object or whatever else you might got, you actually gotNone
, for example likefund_me
returns None orbad_actor
isNone
. So I wonder if you cloned the entire repo and executed the test on it, or you cloned the repo and just replaced the test script into your code? If is the second one, you may have something else missing elsewhere.