-
Notifications
You must be signed in to change notification settings - Fork 263
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
921 #922
921 #922
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Nice cleanup! 👍
opponent = axelrod.Cooperator() | ||
self.assertEqual('C', player.strategy(opponent)) | ||
def test_soft(self): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here? Does it need a test to be added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's just to override the test from TestGoByMajority, that checks the soft argument works correctly. Since HardGoByMajority doesn't have a soft argument anymore, that test isn't needed and was causing an exception if I didn't override it to remove it. I thought about not making TestHardGoByMajority inherite from TestGoByMajority at all, but there are still enough common points between the two for it to be meaningful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could have used delattr instead.
opponent = axelrod.Cooperator() | ||
self.assertEqual('C', player.strategy(opponent)) | ||
def test_soft(self): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Could you add a comment to explain the need for line 78? (I had to ask this again to keep github's review process happy).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do tonight !
So, maybe I got a little over-enthusiastic here, but I modified more things than planned. Instead of adding a comment, I finally concluded that, since |
I don't think we have any to be overstepped! I'll have a proper look at this in the morning. |
Looks good to me! |
👍 |
#921
I took more time than I though to correct the tests, since
TestHardGoByMajority
usesTestGoByMajority
. Tell me if there is a problem with how I changed things.And I also corrected the type hint of memory_depth which indicated
float
even though, as the docstring says on line 37 :(default value
float('inf')
must have confused the contributor)