Commits

zjes committed 8f78c7b

Add __pycache__ to default ignore config, and fix some issues

  • Participants
  • Parent commits 6771411

Comments (0)

Files changed (3)

File rope/base/default_config.py

     # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
     # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
     prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject',
-                                  '.hg', '.svn', '_svn', '.git']
+                                  '.hg', '.svn', '_svn', '.git', 
+                                  '__pycache__']
 
     # Specifies which files should be considered python files.  It is
     # useful when you have scripts inside your project.  Only files

File rope/base/resources.py

             raise exceptions.ModuleDecodeError(self.path, e.reason)
 
     def read_bytes(self):
-        return open(self.real_path, 'rb').read()
+        with open(self.real_path, 'rb') as fi:
+            return fi.read()
 
     def write(self, contents):
         try:

File ropetest/projecttest.py

         unittest.TestCase.tearDown(self)
 
     def test_project_creation(self):
-        self.assertEquals(_realpath(self.project_root),
+        self.assertEqual(_realpath(self.project_root),
                           self.project.address)
 
     def test_getting_project_file(self):
 
     def test_project_file_reading(self):
         projectFile = self.project.get_resource(self.sample_file)
-        self.assertEquals('sample text\n', projectFile.read())
+        self.assertEqual('sample text\n', projectFile.read())
 
     @testutils.assert_raises(ResourceNotFoundError)
     def test_getting_not_existing_project_file(self):
     def test_writing_in_project_files(self):
         project_file = self.project.get_resource(self.sample_file)
         project_file.write('another text\n')
-        self.assertEquals('another text\n', project_file.read())
+        self.assertEqual('another text\n', project_file.read())
 
     def test_creating_files(self):
         project_file = 'newfile.txt'
         parent_folder.create_file(file_name)
         file = self.project.get_resource(file_path)
         file.write('sample notes')
-        self.assertEquals(file_path, file.path)
-        self.assertEquals('sample notes', open(os.path.join(self.project.address,
-                                                            file_path)).read())
+        self.assertEqual(file_path, file.path)
+        with open(os.path.join(self.project.address, file_path)) as fi:
+            self.assertEqual('sample notes', fi.read())
 
     @testutils.assert_raises(ResourceNotFoundError)
     def test_failing_when_creating_file_inside_non_existent_folder(self):
 
     def test_file_get_name(self):
         file = self.project.get_resource(self.sample_file)
-        self.assertEquals(self.sample_file, file.name)
+        self.assertEqual(self.sample_file, file.name)
         file_name = 'nestedFile.txt'
         parent = self.project.get_resource(self.sample_folder)
         filePath = self.sample_folder + '/' + file_name
         parent.create_file(file_name)
         nestedFile = self.project.get_resource(filePath)
-        self.assertEquals(file_name, nestedFile.name)
+        self.assertEqual(file_name, nestedFile.name)
 
     def test_folder_get_name(self):
         folder = self.project.get_resource(self.sample_folder)
-        self.assertEquals(self.sample_folder, folder.name)
+        self.assertEqual(self.sample_folder, folder.name)
 
     def test_file_get_path(self):
         file = self.project.get_resource(self.sample_file)
-        self.assertEquals(self.sample_file, file.path)
+        self.assertEqual(self.sample_file, file.path)
         fileName = 'nestedFile.txt'
         parent = self.project.get_resource(self.sample_folder)
         filePath = self.sample_folder + '/' + fileName
         parent.create_file(fileName)
         nestedFile = self.project.get_resource(filePath)
-        self.assertEquals(filePath, nestedFile.path)
+        self.assertEqual(filePath, nestedFile.path)
 
     def test_folder_get_path(self):
         folder = self.project.get_resource(self.sample_folder)
-        self.assertEquals(self.sample_folder, folder.path)
+        self.assertEqual(self.sample_folder, folder.path)
 
     def test_is_folder(self):
         self.assertTrue(self.project.get_resource(self.sample_folder).is_folder())
 
     def testget_children(self):
         children = self.project.get_resource(self.sample_folder).get_children()
-        self.assertEquals([], children)
+        self.assertEqual([], children)
 
     def test_nonempty_get_children(self):
         file_name = 'nestedfile.txt'
         parent = self.project.get_resource(self.sample_folder)
         parent.create_file(file_name)
         children = parent.get_children()
-        self.assertEquals(1, len(children))
-        self.assertEquals(filePath, children[0].path)
+        self.assertEqual(1, len(children))
+        self.assertEqual(filePath, children[0].path)
 
     def test_nonempty_get_children2(self):
         file_name = 'nestedfile.txt'
         parent.create_file(file_name)
         parent.create_folder(folder_name)
         children = parent.get_children()
-        self.assertEquals(2, len(children))
+        self.assertEqual(2, len(children))
         self.assertTrue(filePath == children[0].path or filePath == children[1].path)
         self.assertTrue(folderPath == children[0].path or folderPath == children[1].path)
 
     def test_getting_files(self):
         files = self.project.root.get_files()
-        self.assertEquals(1, len(files))
+        self.assertEqual(1, len(files))
         self.assertTrue(self.project.get_resource(self.sample_file) in files)
 
     def test_getting_folders(self):
         folders = self.project.root.get_folders()
-        self.assertEquals(1, len(folders))
+        self.assertEqual(1, len(folders))
         self.assertTrue(self.project.get_resource(self.sample_folder) in folders)
 
     def test_nested_folder_get_files(self):
         parent.create_file('file1.txt')
         parent.create_file('file2.txt')
         files = parent.get_files()
-        self.assertEquals(2, len(files))
+        self.assertEqual(2, len(files))
         self.assertTrue(self.project.get_resource('top/file2.txt') in files)
-        self.assertEquals(0, len(parent.get_folders()))
+        self.assertEqual(0, len(parent.get_folders()))
 
     def test_nested_folder_get_folders(self):
         parent = self.project.root.create_folder('top')
         parent.create_folder('dir1')
         parent.create_folder('dir2')
         folders = parent.get_folders()
-        self.assertEquals(2, len(folders))
+        self.assertEqual(2, len(folders))
         self.assertTrue(self.project.get_resource('top/dir1') in folders)
-        self.assertEquals(0, len(parent.get_files()))
+        self.assertEqual(0, len(parent.get_files()))
 
     def test_root_folder(self):
         root_folder = self.project.root
-        self.assertEquals(2, len(root_folder.get_children()))
-        self.assertEquals('', root_folder.path)
-        self.assertEquals('', root_folder.name)
+        self.assertEqual(2, len(root_folder.get_children()))
+        self.assertEqual('', root_folder.path)
+        self.assertEqual('', root_folder.name)
 
     def test_get_all_files(self):
         files = tuple(self.project.get_files())
-        self.assertEquals(1, len(files))
-        self.assertEquals(self.sample_file, files[0].name)
+        self.assertEqual(1, len(files))
+        self.assertEqual(self.sample_file, files[0].name)
 
     def test_get_all_files_after_changing(self):
-        self.assertEquals(1, len(self.project.get_files()))
+        self.assertEqual(1, len(self.project.get_files()))
         myfile = self.project.root.create_file('myfile.txt')
-        self.assertEquals(2, len(self.project.get_files()))
+        self.assertEqual(2, len(self.project.get_files()))
         myfile.move('newfile.txt')
-        self.assertEquals(2, len(self.project.get_files()))
+        self.assertEqual(2, len(self.project.get_files()))
         self.project.get_file('newfile.txt').remove()
-        self.assertEquals(1, len(self.project.get_files()))
+        self.assertEqual(1, len(self.project.get_files()))
 
     def test_multifile_get_all_files(self):
         fileName = 'nestedFile.txt'
         parent = self.project.get_resource(self.sample_folder)
         parent.create_file(fileName)
         files = list(self.project.get_files())
-        self.assertEquals(2, len(files))
+        self.assertEqual(2, len(files))
         self.assertTrue(fileName == files[0].name or fileName == files[1].name)
 
     def test_ignoring_dot_pyc_files_in_get_files(self):
         test_pyc = os.path.join(src_folder, 'test.pyc')
         open(test_pyc, 'w').close()
         for x in self.project.get_files():
-            self.assertNotEquals('src/test.pyc', x.path)
+            self.assertNotEqual('src/test.pyc', x.path)
 
     def test_folder_creating_files(self):
         projectFile = 'NewFile.txt'
         folder = self.project.root
         folder.create_file('myfile.txt')
         folder.create_folder('myfolder')
-        self.assertEquals(self.project.get_resource('myfile.txt'),
+        self.assertEqual(self.project.get_resource('myfile.txt'),
                           folder.get_child('myfile.txt'))
-        self.assertEquals(self.project.get_resource('myfolder'),
+        self.assertEqual(self.project.get_resource('myfolder'),
                           folder.get_child('myfolder'))
 
     def test_folder_get_child_nested(self):
         folder = root.create_folder('myfolder')
         folder.create_file('myfile.txt')
         folder.create_folder('myfolder')
-        self.assertEquals(self.project.get_resource('myfolder/myfile.txt'),
+        self.assertEqual(self.project.get_resource('myfolder/myfile.txt'),
                           folder.get_child('myfile.txt'))
-        self.assertEquals(self.project.get_resource('myfolder/myfolder'),
+        self.assertEqual(self.project.get_resource('myfolder/myfolder'),
                           folder.get_child('myfolder'))
 
     def test_project_root_is_root_folder(self):
-        self.assertEquals('', self.project.root.path)
+        self.assertEqual('', self.project.root.path)
 
     def test_moving_files(self):
         root_folder = self.project.root
         my_file = root_folder.create_file('my_file.txt')
         old_hash = hash(my_file)
         my_file.move('my_other_file.txt')
-        self.assertEquals(old_hash, hash(my_file))
+        self.assertEqual(old_hash, hash(my_file))
 
     def test_file_encoding_reading(self):
         sample_file = self.project.root.create_file('my_file.txt')
         file = open(sample_file.real_path, 'wb')
         file.write(contents.encode('utf-8'))
         file.close()
-        self.assertEquals(contents, sample_file.read())
+        self.assertEqual(contents, sample_file.read())
 
     def test_file_encoding_writing(self):
         sample_file = self.project.root.create_file('my_file.txt')
         contents = '# -*- coding: utf-8 -*-\n\N{LATIN SMALL LETTER I WITH DIAERESIS}\n'
         sample_file.write(contents)
-        self.assertEquals(contents, sample_file.read())
+        self.assertEqual(contents, sample_file.read())
 
     def test_using_utf8_when_writing_in_case_of_errors(self):
         sample_file = self.project.root.create_file('my_file.txt')
         contents = '\n\N{LATIN SMALL LETTER I WITH DIAERESIS}\n'
         sample_file.write(contents)
-        self.assertEquals(contents, sample_file.read())
+        self.assertEqual(contents, sample_file.read())
 
     def test_encoding_declaration_in_the_second_line(self):
         sample_file = self.project.root.create_file('my_file.txt')
         file = open(sample_file.real_path, 'wb')
         file.write(contents)
         file.close()
-        self.assertEquals(contents, sample_file.read().encode('latin-1'))
+        self.assertEqual(contents, sample_file.read().encode('latin-1'))
 
     def test_read_bytes(self):
         sample_file = self.project.root.create_file('my_file.txt')
         file = open(sample_file.real_path, 'wb')
         file.write(contents)
         file.close()
-        self.assertEquals(contents, sample_file.read_bytes())
+        self.assertEqual(contents, sample_file.read_bytes())
 
     # TODO: Detecting utf-16 encoding
     def xxx_test_using_utf16(self):
         file.write(contents.encode('utf-16'))
         file.close()
         sample_file.write(contents)
-        self.assertEquals(contents, sample_file.read())
+        self.assertEqual(contents, sample_file.read())
 
     # XXX: supporting utf_8_sig
     def xxx_test_file_encoding_reading_for_notepad_styles(self):
         # file.write('\xef\xbb\xbf')
         file.write(contents.encode('utf-8-sig'))
         file.close()
-        self.assertEquals(contents, sample_file.read())
+        self.assertEqual(contents, sample_file.read())
 
     def test_using_project_get_file(self):
         myfile = self.project.get_file(self.sample_file)
 
     def test_simple_path_to_resource(self):
         myfile = self.project.root.create_file('myfile.txt')
-        self.assertEquals(myfile, path_to_resource(self.project,
+        self.assertEqual(myfile, path_to_resource(self.project,
                                                    myfile.real_path))
-        self.assertEquals(myfile, path_to_resource(
+        self.assertEqual(myfile, path_to_resource(
                           self.project, myfile.real_path, type='file'))
         myfolder = self.project.root.create_folder('myfolder')
-        self.assertEquals(myfolder, path_to_resource(self.project,
+        self.assertEqual(myfolder, path_to_resource(self.project,
                                                      myfolder.real_path))
-        self.assertEquals(myfolder, path_to_resource(
+        self.assertEqual(myfolder, path_to_resource(
                           self.project, myfolder.real_path, type='folder'))
 
     @testutils.run_only_for_unix
             path = os.path.join(self.project.address, 'linkedfile.txt')
             os.symlink(mod.real_path, path)
             files = self.project.root.get_files()
-            self.assertEquals(1, len(files))
+            self.assertEqual(1, len(files))
         finally:
             testutils.remove_project(project2)
 
         sample_observer = _SampleObserver()
         self.project.add_observer(sample_observer)
         sample_file.write('a sample file version 2')
-        self.assertEquals(1, sample_observer.change_count)
-        self.assertEquals(sample_file, sample_observer.last_changed)
+        self.assertEqual(1, sample_observer.change_count)
+        self.assertEqual(sample_file, sample_observer.last_changed)
 
     def test_resource_change_observer_after_removal(self):
         sample_file = self.project.root.create_file('my_file.txt')
         self.project.add_observer(FilteredResourceObserver(sample_observer,
                                                            [sample_file]))
         sample_file.remove()
-        self.assertEquals(1, sample_observer.change_count)
-        self.assertEquals(sample_file, sample_observer.last_removed)
+        self.assertEqual(1, sample_observer.change_count)
+        self.assertEqual(sample_file, sample_observer.last_removed)
 
     def test_resource_change_observer2(self):
         sample_file = self.project.root.create_file('my_file.txt')
         self.project.add_observer(sample_observer)
         self.project.remove_observer(sample_observer)
         sample_file.write('a sample file version 2')
-        self.assertEquals(0, sample_observer.change_count)
+        self.assertEqual(0, sample_observer.change_count)
 
     def test_resource_change_observer_for_folders(self):
         root_folder = self.project.root
         self.project.add_observer(FilteredResourceObserver(root_folder_observer,
                                                            [root_folder]))
         my_file = my_folder.create_file('my_file.txt')
-        self.assertEquals(1, my_folder_observer.change_count)
+        self.assertEqual(1, my_folder_observer.change_count)
         my_file.move('another_file.txt')
-        self.assertEquals(2, my_folder_observer.change_count)
-        self.assertEquals(1, root_folder_observer.change_count)
+        self.assertEqual(2, my_folder_observer.change_count)
+        self.assertEqual(1, root_folder_observer.change_count)
         self.project.get_resource('another_file.txt').remove()
-        self.assertEquals(2, my_folder_observer.change_count)
-        self.assertEquals(2, root_folder_observer.change_count)
+        self.assertEqual(2, my_folder_observer.change_count)
+        self.assertEqual(2, root_folder_observer.change_count)
 
     def test_resource_change_observer_after_moving(self):
         sample_file = self.project.root.create_file('my_file.txt')
         sample_observer = _SampleObserver()
         self.project.add_observer(sample_observer)
         sample_file.move('new_file.txt')
-        self.assertEquals(1, sample_observer.change_count)
-        self.assertEquals((sample_file, self.project.get_resource('new_file.txt')),
+        self.assertEqual(1, sample_observer.change_count)
+        self.assertEqual((sample_file, self.project.get_resource('new_file.txt')),
                            sample_observer.last_moved)
 
     def test_revalidating_files(self):
                                                            [my_file]))
         os.remove(my_file.real_path)
         self.project.validate(root)
-        self.assertEquals(my_file, sample_observer.last_removed)
-        self.assertEquals(1, sample_observer.change_count)
+        self.assertEqual(my_file, sample_observer.last_removed)
+        self.assertEqual(1, sample_observer.change_count)
 
     def test_revalidating_files_and_no_changes2(self):
         root = self.project.root
         self.project.add_observer(FilteredResourceObserver(sample_observer,
                                                            [my_file]))
         self.project.validate(root)
-        self.assertEquals(None, sample_observer.last_moved)
-        self.assertEquals(0, sample_observer.change_count)
+        self.assertEqual(None, sample_observer.last_moved)
+        self.assertEqual(0, sample_observer.change_count)
 
     def test_revalidating_folders(self):
         root = self.project.root
                                                            [my_folder]))
         testutils.remove_recursively(my_folder.real_path)
         self.project.validate(root)
-        self.assertEquals(my_folder, sample_observer.last_removed)
-        self.assertEquals(1, sample_observer.change_count)
+        self.assertEqual(my_folder, sample_observer.last_removed)
+        self.assertEqual(1, sample_observer.change_count)
 
     def test_removing_and_adding_resources_to_filtered_observer(self):
         my_file = self.project.root.create_file('my_file.txt')
         filtered_observer = FilteredResourceObserver(sample_observer)
         self.project.add_observer(filtered_observer)
         my_file.write('1')
-        self.assertEquals(0, sample_observer.change_count)
+        self.assertEqual(0, sample_observer.change_count)
         filtered_observer.add_resource(my_file)
         my_file.write('2')
-        self.assertEquals(1, sample_observer.change_count)
+        self.assertEqual(1, sample_observer.change_count)
         filtered_observer.remove_resource(my_file)
         my_file.write('3')
-        self.assertEquals(1, sample_observer.change_count)
+        self.assertEqual(1, sample_observer.change_count)
 
     def test_validation_and_changing_files(self):
         my_file = self.project.root.create_file('my_file.txt')
         self._write_file(my_file.real_path)
         timekeeper.set_indicator(my_file, 1)
         self.project.validate(self.project.root)
-        self.assertEquals(1, sample_observer.change_count)
+        self.assertEqual(1, sample_observer.change_count)
 
     def test_validation_and_changing_files2(self):
         my_file = self.project.root.create_file('my_file.txt')
                                   timekeeper=timekeeper))
         timekeeper.set_indicator(my_file, 1)
         my_file.write('hey')
-        self.assertEquals(1, sample_observer.change_count)
+        self.assertEqual(1, sample_observer.change_count)
         self.project.validate(self.project.root)
-        self.assertEquals(1, sample_observer.change_count)
+        self.assertEqual(1, sample_observer.change_count)
 
     def test_not_reporting_multiple_changes_to_folders(self):
         root = self.project.root
                                   sample_observer, [root, file1, file2]))
         os.remove(file1.real_path)
         os.remove(file2.real_path)
-        self.assertEquals(0, sample_observer.change_count)
+        self.assertEqual(0, sample_observer.change_count)
         self.project.validate(self.project.root)
-        self.assertEquals(3, sample_observer.change_count)
+        self.assertEqual(3, sample_observer.change_count)
 
     def _write_file(self, path):
         my_file = open(path, 'w')
             sample_observer, [my_folder, my_file])
         self.project.add_observer(filtered_observer)
         my_folder.move('new_folder')
-        self.assertEquals(2, sample_observer.change_count)
+        self.assertEqual(2, sample_observer.change_count)
 
     def test_contains_for_folders(self):
         folder1 = self.project.root.create_folder('folder')
                                                            [my_file]))
         open(my_file.real_path, 'w').close()
         self.project.validate(root)
-        self.assertEquals(my_file, sample_observer.last_created)
-        self.assertEquals(1, sample_observer.change_count)
+        self.assertEqual(my_file, sample_observer.last_created)
+        self.assertEqual(1, sample_observer.change_count)
 
     def test_validating_twice_when_created(self):
         root = self.project.root
         open(my_file.real_path, 'w').close()
         self.project.validate(root)
         self.project.validate(root)
-        self.assertEquals(my_file, sample_observer.last_created)
-        self.assertEquals(1, sample_observer.change_count)
+        self.assertEqual(my_file, sample_observer.last_created)
+        self.assertEqual(1, sample_observer.change_count)
 
     def test_changes_and_adding_resources(self):
         root = self.project.root
         self.project.add_observer(FilteredResourceObserver(sample_observer,
                                                            [file1, file2]))
         file1.move(file2.path)
-        self.assertEquals(2, sample_observer.change_count)
-        self.assertEquals(file2, sample_observer.last_created)
-        self.assertEquals((file1, file2), sample_observer.last_moved)
+        self.assertEqual(2, sample_observer.change_count)
+        self.assertEqual(file2, sample_observer.last_created)
+        self.assertEqual((file1, file2), sample_observer.last_moved)
 
     def test_validating_get_files_list(self):
         root = self.project.root
-        self.assertEquals(0, len(self.project.get_files()))
+        self.assertEqual(0, len(self.project.get_files()))
         file = open(os.path.join(self.project.address, 'myfile.txt'), 'w')
         file.close()
         self.project.validate()
-        self.assertEquals(1, len(self.project.get_files()))
+        self.assertEqual(1, len(self.project.get_files()))
 
     def test_clear_observered_resources_for_filtered_observers(self):
         sample_file = self.project.root.create_file('myfile.txt')
         filtered.add_resource(sample_file)
         filtered.clear_resources()
         sample_file.write('1')
-        self.assertEquals(0, sample_observer.change_count)
+        self.assertEqual(0, sample_observer.change_count)
 
 
 class _MockChangeIndicator(object):
         sample_file.write('sample content\n')
         sample_file.close()
         sample_resource = self.no_project.get_resource(sample_file_path)
-        self.assertEquals('sample content\n', sample_resource.read())
+        self.assertEqual('sample content\n', sample_resource.read())
 
     def test_simple_out_of_project_folder(self):
         sample_folder_path = os.path.join(self.test_directory, 'sample_folder')
         os.mkdir(sample_folder_path)
         sample_folder = self.no_project.get_resource(sample_folder_path)
-        self.assertEquals([], sample_folder.get_children())
+        self.assertEqual([], sample_folder.get_children())
 
         sample_file_path = os.path.join(sample_folder_path, 'sample.txt')
         open(sample_file_path, 'w').close()
         sample_resource = self.no_project.get_resource(sample_file_path)
-        self.assertEquals(sample_resource, sample_folder.get_children()[0])
+        self.assertEqual(sample_resource, sample_folder.get_children()[0])
 
     def test_using_absolute_path(self):
         sample_file_path = os.path.join(self.test_directory, 'sample.txt')
         normal_sample_resource = self.no_project.get_resource(sample_file_path)
         absolute_sample_resource = \
             self.no_project.get_resource(os.path.abspath(sample_file_path))
-        self.assertEquals(normal_sample_resource, absolute_sample_resource)
+        self.assertEqual(normal_sample_resource, absolute_sample_resource)
 
     def test_folder_get_child(self):
         sample_folder_path = os.path.join(self.test_directory, 'sample_folder')
         os.mkdir(sample_folder_path)
         sample_folder = self.no_project.get_resource(sample_folder_path)
-        self.assertEquals([], sample_folder.get_children())
+        self.assertEqual([], sample_folder.get_children())
 
         sample_file_path = os.path.join(sample_folder_path, 'sample.txt')
         open(sample_file_path, 'w').close()
         sample_resource = self.no_project.get_resource(sample_file_path)
         self.assertTrue(sample_folder.has_child('sample.txt'))
         self.assertFalse(sample_folder.has_child('doesnothave.txt'))
-        self.assertEquals(sample_resource, sample_folder.get_child('sample.txt'))
+        self.assertEqual(sample_resource, sample_folder.get_child('sample.txt'))
 
     def test_out_of_project_files_and_path_to_resource(self):
         sample_file_path = os.path.join(self.test_directory, 'sample.txt')
         sample_file.write('sample content\n')
         sample_file.close()
         sample_resource = self.no_project.get_resource(sample_file_path)
-        self.assertEquals(sample_resource,
+        self.assertEqual(sample_resource,
                           path_to_resource(self.project, sample_file_path))
 
 
         self.project = testutils.sample_project(
             ignored_resources=['myfile.txt'], ropefolder=None)
         myfile = self.project.get_file('myfile.txt')
-        self.assertEquals(0, len(self.project.get_files()))
+        self.assertEqual(0, len(self.project.get_files()))
         myfile.create()
-        self.assertEquals(0, len(self.project.get_files()))
+        self.assertEqual(0, len(self.project.get_files()))
 
     def test_ignored_resources_and_get_files2(self):
         self.project = testutils.sample_project(
             ignored_resources=['myfile.txt'], ropefolder=None)
         myfile = self.project.root.create_file('myfile.txt')
-        self.assertEquals(0, len(self.project.get_files()))
+        self.assertEqual(0, len(self.project.get_files()))
 
     def test_setting_ignored_resources_patterns(self):
         self.project = testutils.sample_project(ignored_resources=['m?file.*'])
             fscommands=fscommands, ignored_resources=['myfile.txt'], ropefolder=None)
         myfile = self.project.get_file('myfile.txt')
         myfile.create()
-        self.assertEquals('', fscommands.log)
+        self.assertEqual('', fscommands.log)
 
     def test_ignored_resources_and_prefixes(self):
         self.project = testutils.sample_project(
     def test_nested_dot_ropeproject_folder(self):
         self.project = testutils.sample_project(ropefolder='.f1/f2')
         ropefolder = self.project.ropefolder
-        self.assertEquals('.f1/f2', ropefolder.path)
+        self.assertEqual('.f1/f2', ropefolder.path)
         self.assertTrue(ropefolder.exists())