Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Accidentally changed submodule code. #337

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

Merged
merged 1 commit into from
Oct 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 8 additions & 26 deletions plotly/matplotlylib/mplexporter/tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
# TODO: matplotlib-build-wip
from nose.plugins.attrib import attr
from plotly.tools import _matplotlylib_imported
from ..exporter import Exporter
from ..renderers import FakeRenderer, FullFakeRenderer

if _matplotlylib_imported:
from ..exporter import Exporter
from ..renderers import FakeRenderer, FullFakeRenderer
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from numpy.testing import assert_warns

import numpy as np
from numpy.testing import assert_warns


@attr('matplotlib')
def fake_renderer_output(fig, Renderer):
renderer = Renderer()
exporter = Exporter(renderer)
exporter.run(fig)
return renderer.output


@attr('matplotlib')
def _assert_output_equal(text1, text2):
for line1, line2 in zip(text1.strip().split(), text2.strip().split()):
assert line1 == line2


@attr('matplotlib')
def test_lines():
fig, ax = plt.subplots()
ax.plot(range(20), '-k')
Expand All @@ -52,7 +44,6 @@ def test_lines():
""")


@attr('matplotlib')
def test_markers():
fig, ax = plt.subplots()
ax.plot(range(2), 'ok')
Expand All @@ -77,7 +68,6 @@ def test_markers():
""")


@attr('matplotlib')
def test_path_collection():
fig, ax = plt.subplots()
ax.scatter(range(3), range(3))
Expand All @@ -103,7 +93,6 @@ def test_path_collection():
""")


@attr('matplotlib')
def test_text():
fig, ax = plt.subplots()
ax.set_xlabel("my x label")
Expand All @@ -124,7 +113,6 @@ def test_text():
""")


@attr('matplotlib')
def test_path():
fig, ax = plt.subplots()
ax.add_patch(plt.Circle((0, 0), 1))
Expand All @@ -141,7 +129,6 @@ def test_path():
""")


@attr('matplotlib')
def test_multiaxes():
fig, ax = plt.subplots(2)
ax[0].plot(range(4))
Expand All @@ -160,7 +147,6 @@ def test_multiaxes():
""")


@attr('matplotlib')
def test_image():
np.random.seed(0) # image size depends on the seed
fig, ax = plt.subplots()
Expand All @@ -177,7 +163,6 @@ def test_image():
""")


@attr('matplotlib')
def test_legend():
fig, ax = plt.subplots()
ax.plot([1,2,3], label='label')
Expand All @@ -193,8 +178,6 @@ def test_legend():
closing figure
""")


@attr('matplotlib')
def test_legend_dots():
fig, ax = plt.subplots()
ax.plot([1,2,3], label='label')
Expand All @@ -217,9 +200,8 @@ def test_legend_dots():
closing figure
""")


@attr('matplotlib')
def test_blended():
fig, ax = plt.subplots()
ax.axvline(0)
assert_warns(UserWarning, fake_renderer_output, fig, FakeRenderer)

11 changes: 3 additions & 8 deletions plotly/matplotlylib/mplexporter/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# TODO: matplotlib-build-wip
from nose.plugins.attrib import attr
from plotly.tools import _matplotlylib_imported
from numpy.testing import assert_allclose, assert_equal
import matplotlib.pyplot as plt
from .. import utils

if _matplotlylib_imported:
from numpy.testing import assert_allclose, assert_equal
import matplotlib.pyplot as plt
from .. import utils

@attr('matplotlib')
def test_path_data():
circle = plt.Circle((0, 0), 1)
vertices, codes = utils.SVG_path(circle.get_path())
Expand Down