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

Update test_stalker.py #943

Merged
merged 16 commits into from Apr 18, 2017
Merged

Update test_stalker.py #943

merged 16 commits into from Apr 18, 2017

Conversation

ghost
Copy link

@ghost ghost commented Mar 29, 2017

No description provided.

@marcharper
Copy link
Member

Hi @alajara . Thanks for the contribution. According to the coveralls we're not covering line 69 anymore. Can you take a look and add or modify a test to make sure it's covered?

Please also take a look at all the tests to make sure they are equivalent to the former tests.

@ghost
Copy link
Author

ghost commented Mar 30, 2017

that one test is giving me a hard time, once the current average score is higher than Cooperation it should defect. Can I get some help on this one.

# Start with cooperation
self.first_play_test(C)

# current_average_score > very_good_score
self.responses_test([D], [C] * 2 + [D] * 4, [D] * 2 + [C] * 4)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two tests here but one replacement. I think if we transcribe the tests exactly we should have the coverage we had before.

This line:

self.responses_test([D], [C] * 2 + [D] * 4, [D] * 2 + [C] * 4)

corresponds to

actions = [(C, D)] * 2 + [(D, C)] * 4 + [(D, *)]

where * indicates a missing value from the original test (since the original test only looked at the player's next move and not the opponent's).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcharper I try changing it to its original state and its still not testing the current_average > very_good_score. Any guidance on how to fix it. Thanks

Copy link
Member

@drvinceknight drvinceknight Apr 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alajara I've opened https://github.com/alajara/Axelrod/pull/4 to this branch.

It includes the test that's missing here. It was a bit tricky to figure out how to get the current_average > very_good_score and I do that by tricking the player to defecting by lying to it about the length of the Match.

Note that that PR also include a merge from master, if you click merge on the PR, it'll automatically appear here and should be good to go.

@drvinceknight
Copy link
Member

@alajara there was a slight error in my PR (apologies).

The first import line needs to be:

import axelrod as axl

It is currently:

import axl as axl

alajara and others added 16 commits April 16, 2017 19:00
unittest on my machine is giving me different results from the results here.
change the results back to the way Appveyor test results show
line 34 test, the test error is showing that stalker will cooperate until the last round, the Mock Player cooperates. I am changing it to the way tests outcomes show. But as previous builds, the current average score > very good score tests does not get tested.
This requires tricking the player to defect before the end of the game.
@drvinceknight
Copy link
Member

I've pushed a fix to your branch on this @alajara. 👍 Assuming tests pass I believe this is good to go.

@marcharper
Copy link
Member

What happened to the commits here?

@drvinceknight
Copy link
Member

drvinceknight commented Apr 17, 2017

What happened to the commits here?

What do you mean? Are you asking why my user name is appearing on them? I don't know. I think this is just a github thing because I pushed to the branch.

The repetition of the same commit message was just how things were before hand (all the hashes are different).

@marcharper
Copy link
Member

Let's squash when we merge this time

@drvinceknight
Copy link
Member

Let's squash when we merge this time

I agree. This looks good to me: feel free to merge @marcharper.

@marcharper marcharper merged commit c4f685d into Axelrod-Python:master Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants