Refs #23919 -- Removed obsolete contextlib.closing() calls (for Python 2).

This commit is contained in:
Tim Graham 2017-01-19 08:50:28 -05:00 committed by GitHub
parent 7d20094996
commit 5320fa77c3
3 changed files with 7 additions and 10 deletions

View file

@ -4,7 +4,6 @@ django.contrib.staticfiles.testing.StaticLiveServerTestCase instead of
django.test.LiveServerTestCase.
"""
import contextlib
import os
from urllib.request import urlopen
@ -86,5 +85,5 @@ class StaticLiveServerView(LiveServerBase):
StaticLiveServerTestCase use of staticfiles' serve() allows it
to discover app's static assets without having to collectstatic first.
"""
with contextlib.closing(self.urlopen('/static/test/file.txt')) as f:
with self.urlopen('/static/test/file.txt') as f:
self.assertEqual(f.read().rstrip(b'\r\n'), b'In static directory.')