Skip to content

Commit

Permalink
Refactor to remove ugly flake8 and pylint disable comments
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 committed Sep 19, 2021
1 parent 54405a6 commit 8a1f313
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions pygmt/tests/test_sphinx_gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
from tempfile import TemporaryDirectory

import pytest
from pygmt.figure import SHOWED_FIGURES, Figure

sphinx_gallery = pytest.importorskip("sphinx_gallery", reason="requires sphinx-gallery")

# pylint: disable=wrong-import-position
from pygmt.figure import SHOWED_FIGURES, Figure # noqa: E402
from pygmt.sphinx_gallery import PyGMTScraper # noqa: E402

# pylint: enable=wrong-import-position
pygmt_sphinx_gallery = pytest.importorskip(
"pygmt.sphinx_gallery", reason="requires sphinx-gallery to be installed"
)


def test_pygmtscraper():
Expand All @@ -29,7 +26,7 @@ def test_pygmtscraper():
fig.show()
assert len(SHOWED_FIGURES) == 1
assert SHOWED_FIGURES[0] is fig
scraper = PyGMTScraper()
scraper = pygmt_sphinx_gallery.PyGMTScraper()
with TemporaryDirectory(dir=os.getcwd()) as tmpdir:
conf = {"src_dir": "meh"}
fname = os.path.join(tmpdir, "meh.png")
Expand Down

0 comments on commit 8a1f313

Please sign in to comment.