change assert(Not)Equals to assert(Not)Equal
According to http://docs.python.org/2/library/unittest.html
assert(Not)Equals is a deprecated alias of assert(Not)Equal.
Change-Id: I2e518d3a92e11e06bacaa67076c0d60ee82ab4a9
Co-Authored-By: Jesse Keating <omgjlk@us.ibm.com>
diff --git a/tests/unit/test_configloader.py b/tests/unit/test_configloader.py
index 3b5c206..f7d580c 100644
--- a/tests/unit/test_configloader.py
+++ b/tests/unit/test_configloader.py
@@ -304,7 +304,7 @@
def test_conflict_config(self):
tenant = self.sched.abide.tenants.get('tenant-one')
jobs = sorted(tenant.layout.jobs.keys())
- self.assertEquals(
+ self.assertEqual(
['base', 'noop', 'trusted-zuul.yaml-job',
'untrusted-zuul.yaml-job'],
jobs)
diff --git a/tests/unit/test_executor.py b/tests/unit/test_executor.py
index 3793edc..9c45645 100755
--- a/tests/unit/test_executor.py
+++ b/tests/unit/test_executor.py
@@ -35,17 +35,17 @@
'Project %s commit for build %s #%s should '
'not have a detached HEAD' % (
project, build, number))
- self.assertEquals(repo.active_branch.name,
- state['branch'],
- 'Project %s commit for build %s #%s should '
- 'be on the correct branch' % (
- project, build, number))
+ self.assertEqual(repo.active_branch.name,
+ state['branch'],
+ 'Project %s commit for build %s #%s should '
+ 'be on the correct branch' % (
+ project, build, number))
if 'commit' in state:
- self.assertEquals(state['commit'],
- str(repo.commit('HEAD')),
- 'Project %s commit for build %s #%s should '
- 'be correct' % (
- project, build, number))
+ self.assertEqual(state['commit'],
+ str(repo.commit('HEAD')),
+ 'Project %s commit for build %s #%s should '
+ 'be correct' % (
+ project, build, number))
ref = repo.commit('HEAD')
repo_messages = set(
[c.message.strip() for c in repo.iter_commits(ref)])
@@ -93,7 +93,7 @@
self.waitUntilSettled()
- self.assertEquals(2, len(self.builds), "Two builds are running")
+ self.assertEqual(2, len(self.builds), "Two builds are running")
upstream = self.getUpstreamRepos(projects)
states = [
@@ -133,7 +133,7 @@
self.waitUntilSettled()
- self.assertEquals(3, len(self.builds), "Three builds are running")
+ self.assertEqual(3, len(self.builds), "Three builds are running")
upstream = self.getUpstreamRepos(projects)
states = [
@@ -194,7 +194,7 @@
self.waitUntilSettled()
- self.assertEquals(4, len(self.builds), "Four builds are running")
+ self.assertEqual(4, len(self.builds), "Four builds are running")
upstream = self.getUpstreamRepos(projects)
states = [
@@ -283,7 +283,7 @@
time.sleep(1)
self.waitUntilSettled()
- self.assertEquals(1, len(self.builds), "One build is running")
+ self.assertEqual(1, len(self.builds), "One build is running")
upstream = self.getUpstreamRepos(projects)
states = [
@@ -326,7 +326,7 @@
time.sleep(1)
self.waitUntilSettled()
- self.assertEquals(2, len(self.builds), "Two builds are running")
+ self.assertEqual(2, len(self.builds), "Two builds are running")
upstream = self.getUpstreamRepos(projects)
states = [
diff --git a/tests/unit/test_gerrit.py b/tests/unit/test_gerrit.py
index a369aff..5ce1aa3 100644
--- a/tests/unit/test_gerrit.py
+++ b/tests/unit/test_gerrit.py
@@ -63,11 +63,11 @@
result = gerrit.simpleQuery('project:openstack-infra/zuul')
_ssh_mock.assert_has_calls(calls)
- self.assertEquals(len(calls), _ssh_mock.call_count,
- '_ssh should be called %d times' % len(calls))
+ self.assertEqual(len(calls), _ssh_mock.call_count,
+ '_ssh should be called %d times' % len(calls))
self.assertIsNotNone(result, 'Result is not none')
- self.assertEquals(len(result), expected_patches,
- 'There must be %d patches.' % expected_patches)
+ self.assertEqual(len(result), expected_patches,
+ 'There must be %d patches.' % expected_patches)
def test_simple_query_pagination_new(self):
files = ['simple_query_pagination_new_1',
diff --git a/tests/unit/test_merger_repo.py b/tests/unit/test_merger_repo.py
index f815344..8aafabf 100644
--- a/tests/unit/test_merger_repo.py
+++ b/tests/unit/test_merger_repo.py
@@ -65,12 +65,12 @@
os.path.join(self.workspace_root, 'subdir', '.git')),
msg='Cloned over the submodule placeholder')
- self.assertEquals(
+ self.assertEqual(
os.path.join(self.upstream_root, 'org/project1'),
work_repo.createRepoObject().remotes[0].url,
message="Parent clone still point to upstream project1")
- self.assertEquals(
+ self.assertEqual(
os.path.join(self.upstream_root, 'org/project2'),
sub_repo.createRepoObject().remotes[0].url,
message="Sub repository points to upstream project2")