Skip to content

test_tinypages: pytest compatible module level setup #6848

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
Aug 2, 2016
Merged
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
14 changes: 6 additions & 8 deletions lib/matplotlib/sphinxext/tests/test_tinypages.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
TINY_PAGES = pjoin(HERE, 'tinypages')


def setup():
# Check we have the sphinx-build command
def setup_module():
"""Check we have the sphinx-build command"""
try:
ret = call(['sphinx-build', '--help'], stdout=PIPE, stderr=PIPE)
except OSError:
Expand All @@ -33,7 +33,7 @@ def file_same(file1, file2):


class TestTinyPages(object):
# Test build and output of tinypages project
"""Test build and output of tinypages project"""

@classmethod
def setup_class(cls):
Expand All @@ -48,14 +48,12 @@ def setup_class(cls):
cls.html_dir]
proc = Popen(cmd, stdout=PIPE, stderr=PIPE)
out, err = proc.communicate()
if proc.returncode != 0:
raise RuntimeError('sphinx-build failed with stdout:\n'
'{0}\nstderr:\n{1}\n'.format(out, err))
except Exception as e:
shutil.rmtree(cls.page_build)
raise e
if proc.returncode != 0:
shutil.rmtree(cls.page_build)
raise RuntimeError('sphinx-build failed with stdout:\n'
'{0}\nstderr:\n{1}\n'.format(
out, err))

@classmethod
def teardown_class(cls):
Expand Down