Show More
@@ -7,13 +7,18 | |||
|
7 | 7 | import glob |
|
8 | 8 | import os |
|
9 | 9 | import re |
|
10 | import sys | |
|
10 | 11 | import tarfile |
|
11 | 12 | import zipfile |
|
12 | from io import BytesIO | |
|
13 | from io import BytesIO, StringIO | |
|
13 | 14 | from os.path import basename, join as pjoin |
|
14 | 15 | from unittest import TestCase |
|
15 | 16 | |
|
16 | import IPython.testing.tools as tt | |
|
17 | try: | |
|
18 | from unittest import mock | |
|
19 | except ImportError: | |
|
20 | import mock # py2 | |
|
21 | ||
|
17 | 22 | import IPython.testing.decorators as dec |
|
18 | 23 | from IPython.utils import py3compat |
|
19 | 24 | from IPython.utils.tempdir import TemporaryDirectory |
@@ -213,8 +218,13 class TestInstallNBExtension(TestCase): | |||
|
213 | 218 | self.assertEqual(new_mtime, old_mtime) |
|
214 | 219 | |
|
215 | 220 | def test_quiet(self): |
|
216 | with tt.AssertNotPrints(re.compile(r'.+')): | |
|
221 | stdout = StringIO() | |
|
222 | stderr = StringIO() | |
|
223 | with mock.patch.object(sys, 'stdout', stdout), \ | |
|
224 | mock.patch.object(sys, 'stderr', stderr): | |
|
217 | 225 | install_nbextension(self.src, verbose=0) |
|
226 | self.assertEqual(stdout.getvalue(), '') | |
|
227 | self.assertEqual(stderr.getvalue(), '') | |
|
218 | 228 | |
|
219 | 229 | def test_install_zip(self): |
|
220 | 230 | path = pjoin(self.src, "myjsext.zip") |
General Comments 0
You need to be logged in to leave comments.
Login now