Merge pull request #3459 from takluyver/appveyor-path-fails

Undo patches in teardown before attempting to delete files
This commit is contained in:
M Pacer 2018-03-22 14:35:58 -07:00 committed by GitHub
commit e433b81bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -178,9 +178,9 @@ class NotebookTestBase(TestCase):
def teardown_class(cls):
cls.notebook.stop()
cls.wait_until_dead()
cls.tmp_dir.cleanup()
cls.env_patch.stop()
cls.path_patch.stop()
cls.tmp_dir.cleanup()
# cleanup global zmq Context, to ensure we aren't leaving dangling sockets
def cleanup_zmq():
zmq.Context.instance().term()

View File

@ -4,6 +4,10 @@ import io
from notebook.utils import url_path_join
from nbformat import write
from nbformat.v4 import new_notebook
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
import requests
@ -28,5 +32,7 @@ class TreeTest(NotebookTestBase):
r = self.request('GET', 'tree/foo/bar.ipynb')
self.assertEqual(r.url, self.base_url() + 'notebooks/foo/bar.ipynb')
r = self.request('GET', 'tree/foo/baz.txt')
self.assertEqual(r.url, url_path_join(self.base_url(), 'files/foo/baz.txt'))
r = self.request('GET', 'tree/foo/baz.txt', allow_redirects=False)
self.assertEqual(r.status_code, 302)
self.assertEqual(r.headers['Location'],
urlparse(url_path_join(self.base_url(), 'files/foo/baz.txt')).path)