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

Spruce up game and its tests #1206

Merged
merged 1 commit into from
Oct 24, 2018
Merged

Conversation

langner
Copy link
Member

@langner langner commented Oct 21, 2018

Continued work for #347

@marcharper
Copy link
Member

Here's the failing test. Otherwise LGTM:

======================================================================
FAIL: test_payoff_with_passed_axes (axelrod.tests.unit.test_plot.TestPlot)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/Axelrod-Python/Axelrod/axelrod/tests/unit/test_plot.py", line 208, in test_payoff_with_passed_axes
    msg="Color bar is not in correct location.",
AssertionError: 0.9179031197390574 != 0.8685161708228115 : Color bar is not in correct location.

@@ -1,33 +1,61 @@
from typing import Tuple, Union

from .action import Action
from axelrod import Action
Copy link
Member

Choose a reason for hiding this comment

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

Why is this better? (I'm perfectly happy, just asking as a learning opportunity :))

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, relative imports are less common (also in the Axelrod library AFAIR) and generally discouraged. The rationale is mostly that relative imports can be ambiguous, whereas absolute ones are not. For more context: https://www.python.org/dev/peps/pep-0328

Copy link
Member

Choose a reason for hiding this comment

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

Awesome: thanks for the explanation.

@langner
Copy link
Member Author

langner commented Oct 23, 2018

Here's the failing test. Otherwise LGTM:

======================================================================
FAIL: test_payoff_with_passed_axes (axelrod.tests.unit.test_plot.TestPlot)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/Axelrod-Python/Axelrod/axelrod/tests/unit/test_plot.py", line 208, in test_payoff_with_passed_axes
    msg="Color bar is not in correct location.",
AssertionError: 0.9179031197390574 != 0.8685161708228115 : Color bar is not in correct location.

Is this related at all?

@marcharper marcharper mentioned this pull request Oct 24, 2018
@marcharper
Copy link
Member

It doesn't appear to be related, see #1207.

@drvinceknight looks like maybe a dependency change broke a test?

@langner
Copy link
Member Author

langner commented Oct 24, 2018

It doesn't appear to be related, see #1207.

@drvinceknight looks like maybe a dependency change broke a test?

I'd bet on matplotlib.

In https://github.com/matplotlib/matplotlib/releases/tag/v3.0.0 I read:
Improvements to automatic layout of titles, ticks, and GridSpec

Checking in #1208...

@langner
Copy link
Member Author

langner commented Oct 24, 2018

... and seems that #1208 does fix it, so something changed with matplotlib 3.0.0 that broke TestPlot.

axelrod/tests/unit/test_game.py Outdated Show resolved Hide resolved
@drvinceknight
Copy link
Member

I'd bet on matplotlib.

Good call! Have rerun the tests and they all look fine. I've opened #1209

@drvinceknight drvinceknight merged commit 36aa63f into Axelrod-Python:master Oct 24, 2018
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

Successfully merging this pull request may close these issues.

None yet

4 participants