Skip to content

Commit

Permalink
Merge pull request #6848 from Kojoley/improve-sphinx-test
Browse files Browse the repository at this point in the history
TST: pytest compatible module level setup
  • Loading branch information
tacaswell committed Aug 2, 2016
2 parents f7ff2fa + 54bb09b commit 31a5e57
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/matplotlib/sphinxext/tests/test_tinypages.py
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

0 comments on commit 31a5e57

Please sign in to comment.