From 5320fa77c3b2bc02ac232c3e0f5279d99a528e6a Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 19 Jan 2017 08:50:28 -0500 Subject: Refs #23919 -- Removed obsolete contextlib.closing() calls (for Python 2). --- tests/staticfiles_tests/test_liveserver.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/staticfiles_tests') diff --git a/tests/staticfiles_tests/test_liveserver.py b/tests/staticfiles_tests/test_liveserver.py index b3727bea12..717de5cf64 100644 --- a/tests/staticfiles_tests/test_liveserver.py +++ b/tests/staticfiles_tests/test_liveserver.py @@ -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.') -- cgit v1.3