Skip to content

Commit

Permalink
Bug 1428045 - Convert print statments to print functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ghickman authored and edmorley committed Mar 21, 2018
1 parent 52ea16a commit 9cdeb46
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions lints/queuelint.py
Expand Up @@ -24,7 +24,7 @@
queues_list = item.value

if queues_list is None:
print "Failed to find list of queues in settings file"
print("Failed to find list of queues in settings file")
sys.exit(1)

for call in queues_list.elts:
Expand All @@ -33,11 +33,11 @@
procfile_queues = set(procfile_queues)

if settings_queues != procfile_queues:
print "ERROR - mismatches found"
print("ERROR - mismatches found")
missing_procfile = procfile_queues - settings_queues
if missing_procfile:
print "The following queues were in the Procfile, but not in the settings file:\n%s\n" % "\n".join(missing_procfile)
print("The following queues were in the Procfile, but not in the settings file:\n%s\n" % "\n".join(missing_procfile))
missing_settings = settings_queues - procfile_queues
if missing_settings:
print "The following queues were in the settings, but not in the Procfile:\n%s\n" % "\n".join(missing_settings)
print("The following queues were in the settings, but not in the Procfile:\n%s\n" % "\n".join(missing_settings))
sys.exit(1)
2 changes: 1 addition & 1 deletion tests/etl/test_perf_schema.py
Expand Up @@ -23,7 +23,7 @@ def test_perf_schema(suite_value, test_value, expected_fail):
}
datum['suites'][0].update(suite_value)
datum['suites'][0]['subtests'][0].update(test_value)
print datum
print(datum)
if expected_fail:
with pytest.raises(jsonschema.ValidationError):
jsonschema.validate(datum, perf_schema)
Expand Down
2 changes: 1 addition & 1 deletion tests/log_parser/test_tasks.py
Expand Up @@ -42,7 +42,7 @@ def test_parse_log(test_repository, failure_classifications, jobs_with_local_log
store_job_data(test_repository, jobs)

# this log generates 4 job detail objects at present
print JobDetail.objects.count() == 4
print(JobDetail.objects.count() == 4)


def test_create_error_summary(failure_classifications,
Expand Down
2 changes: 1 addition & 1 deletion tests/model/test_bugscache.py
Expand Up @@ -120,7 +120,7 @@ def test_get_recent_resolved_bugs(transactional_db, sample_bugs):
_update_bugscache(bug_list)

suggestions = Bugscache.search(search_term)
print suggestions
print(suggestions)
assert len(suggestions['open_recent']) == 0
all_others_bugs = [b['id'] for b in suggestions['all_others']]
assert all_others_bugs == exp_bugs
Expand Down
22 changes: 11 additions & 11 deletions tests/webapp/api/test_bugzilla.py
Expand Up @@ -16,8 +16,8 @@ def request_callback(request):
headers = {}
requestdata = json.loads(request.body)
requestheaders = request.headers
print requestdata
print requestheaders
print(requestdata)
print(requestheaders)
assert requestheaders['x-bugzilla-api-key'] == "12345helloworld"
assert requestdata['product'] == "Bugzilla"
assert requestdata['description'] == u"Filed by: {}\n\nIntermittent Description".format(test_user.email.replace('@', " [at] "))
Expand Down Expand Up @@ -65,8 +65,8 @@ def request_callback(request):
headers = {}
requestdata = json.loads(request.body)
requestheaders = request.headers
print requestdata
print requestheaders
print(requestdata)
print(requestheaders)
assert requestheaders['x-bugzilla-api-key'] == "12345helloworld"
assert requestdata['product'] == "Bugzilla"
assert requestdata['description'] == u"Filed by: {}\n\nIntermittent “description” string".format(test_user.email.replace('@', " [at] "))
Expand Down Expand Up @@ -155,7 +155,7 @@ def request_callback(request):

content = json.loads(resp.content)

print content
print(content)
assert content['success'] == 323


Expand All @@ -168,8 +168,8 @@ def request_callback(request):
headers = {}
requestdata = json.loads(request.body)
requestheaders = request.headers
print requestdata
print requestheaders
print(requestdata)
print(requestheaders)
assert requestheaders['x-bugzilla-api-key'] == "12345helloworld"
assert requestdata['product'] == "Bugzilla"
assert requestdata['description'] == u"Filed by: MyName\n\nIntermittent Description"
Expand Down Expand Up @@ -210,7 +210,7 @@ def request_callback(request):

content = json.loads(resp.content)

print content
print(content)
assert content['detail'] == "Authentication credentials were not provided."


Expand All @@ -223,8 +223,8 @@ def request_callback(request):
headers = {}
requestdata = json.loads(request.body)
requestheaders = request.headers
print requestdata
print requestheaders
print(requestdata)
print(requestheaders)
assert requestheaders['x-bugzilla-api-key'] == "12345helloworld"
assert requestdata['product'] == "Bugzilla"
assert requestdata['description'] == u"Filed by: MyName\n\nIntermittent Description"
Expand Down Expand Up @@ -269,5 +269,5 @@ def request_callback(request):

content = json.loads(resp.content)

print content
print(content)
assert content['failure'] == "Crash signature can't be more than 2048 characters."
4 changes: 2 additions & 2 deletions tests/webapp/api/test_job_details_api.py
Expand Up @@ -44,13 +44,13 @@ def test_job_details(test_repository, failure_classifications,
repository = test_repository2
push_id = 2
i = 1
print (i, repository)
print(i, repository)
job = create_generic_job(job_guid, repository, push_id,
generic_reference_data)
JobDetail.objects.create(
job=job, **params)
i += 1
print JobDetail.objects.filter(job__guid='abcd')
print(JobDetail.objects.filter(job__guid='abcd'))

# trying to get them all should return an error
resp = webapp.get(reverse('jobdetail-list'), expect_errors=True)
Expand Down
8 changes: 4 additions & 4 deletions treeherder/perf/management/commands/test_analyze_perf.py
Expand Up @@ -60,9 +60,9 @@ def handle(self, *args, **options):
option_collection_hash = pc.get_option_collection_hash()

# print csv header
print ','.join(["project", "platform", "signature", "series",
print(','.join(["project", "platform", "signature", "series",
"testrun_id", "push_timestamp", "change",
"percent change", "t-value", "revision"])
"percent change", "t-value", "revision"]))

for project in options['project']:
if options['signature']:
Expand Down Expand Up @@ -112,11 +112,11 @@ def handle(self, *args, **options):
else:
pct_change = 0.0
delta = (new_value - initial_value)
print ','.join(map(
print(','.join(map(
lambda v: str(v),
[project, series_properties['machine_platform'],
signature, self._get_series_description(
option_collection_hash,
series_properties),
r.testrun_id, r.push_timestamp, delta,
pct_change, r.t, revision[0:12]]))
pct_change, r.t, revision[0:12]])))

0 comments on commit 9cdeb46

Please sign in to comment.