From d9aced73f16b37eb24b24778f8f448769f1a7665 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sat, 7 Jun 2014 13:51:42 +0300 Subject: The file() builtin has been removed in Python 3. Use open() instead. --- mediagoblin/tests/test_pluginapi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mediagoblin/tests/test_pluginapi.py') diff --git a/mediagoblin/tests/test_pluginapi.py b/mediagoblin/tests/test_pluginapi.py index eae0ce15..5a3d41e6 100644 --- a/mediagoblin/tests/test_pluginapi.py +++ b/mediagoblin/tests/test_pluginapi.py @@ -421,7 +421,7 @@ def test_plugin_assetlink(static_plugin_app): junk_file_path = os.path.join( linked_assets_dir.rstrip(os.path.sep), 'junk.txt') - with file(junk_file_path, 'w') as junk_file: + with open(junk_file_path, 'w') as junk_file: junk_file.write('barf') os.unlink(plugin_link_dir) @@ -440,14 +440,14 @@ to: # link dir exists, but is a non-symlink os.unlink(plugin_link_dir) - with file(plugin_link_dir, 'w') as clobber_file: + with open(plugin_link_dir, 'w') as clobber_file: clobber_file.write('clobbered!') result = run_assetlink().collection[0] assert result == 'Could not link "staticstuff": %s exists and is not a symlink\n' % ( plugin_link_dir) - with file(plugin_link_dir, 'r') as clobber_file: + with open(plugin_link_dir, 'r') as clobber_file: assert clobber_file.read() == 'clobbered!' -- cgit v1.2.3