Commit ea576715 authored by Jason R. Coombs's avatar Jason R. Coombs

Use quiet context

parent 2ebaaf23
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
""" """
import os import os
import site import site
import sys
import pytest import pytest
from setuptools.compat import StringIO, PY2 from setuptools.compat import PY2
from setuptools.command.test import test from setuptools.command.test import test
from setuptools.dist import Distribution from setuptools.dist import Distribution
from .textwrap import DALS from .textwrap import DALS
from . import contexts
SETUP_PY = DALS(""" SETUP_PY = DALS("""
from setuptools import setup from setuptools import setup
...@@ -90,13 +90,10 @@ class TestTestTest: ...@@ -90,13 +90,10 @@ class TestTestTest:
cmd.ensure_finalized() cmd.ensure_finalized()
cmd.install_dir = site.USER_SITE cmd.install_dir = site.USER_SITE
cmd.user = 1 cmd.user = 1
old_stdout = sys.stdout with contexts.quiet():
sys.stdout = StringIO() try:
try:
try: # try/except/finally doesn't work in Python 2.4, so we need nested try-statements.
cmd.run() cmd.run()
except SystemExit: # The test runner calls sys.exit, stop that making an error. except SystemExit:
# The test runner calls sys.exit; suppress the exception
pass pass
finally:
sys.stdout = old_stdout
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment