Skip to content

Commit 03c171a

Browse files
author
David Noble
committed
Python 2.6 compatibility change in test_searchcommands_app.py
1 parent e2d05a0 commit 03c171a

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

tests/test_searchcommands_app.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -383,18 +383,14 @@ def test_streaming_command_on_server(self):
383383
def _assertCorrectConfiguration(self, command, test_name):
384384
expected_file_location = os.path.join('_expected_results', test_name + '.txt')
385385
output_file_location = os.path.join('output', test_name + '.csv')
386-
with \
387-
TestSearchCommandsApp._open_data_file(
388-
'input/_empty.csv', 'r') as input_file, \
389-
TestSearchCommandsApp._open_data_file(
390-
output_file_location, 'w') as output_file:
391-
command.process(
392-
[command.name, '__GETINFO__', 'fieldname="foo"'],
393-
input_file,
394-
output_file)
386+
with TestSearchCommandsApp._open_data_file('input/_empty.csv', 'r') as input_file:
387+
with TestSearchCommandsApp._open_data_file(output_file_location, 'w') as output_file:
388+
command.process(
389+
[command.name, '__GETINFO__', 'fieldname="foo"'],
390+
input_file,
391+
output_file)
395392
actual = str(command.configuration)
396-
with TestSearchCommandsApp._open_data_file(
397-
expected_file_location, 'r') as input_file:
393+
with TestSearchCommandsApp._open_data_file(expected_file_location, 'r') as input_file:
398394
expected = ''.join(input_file.readlines())
399395
self.assertMultiLineEqual(expected, actual)
400396

@@ -416,11 +412,10 @@ def _assertCorrectOneshotResults(self, query, test_name):
416412
def _assertCorrectOutputFile(self, name):
417413
expected = os.path.join('_expected_results', name)
418414
actual = os.path.join('output', name)
419-
with \
420-
TestSearchCommandsApp._open_data_file(expected, 'r') as expected, \
421-
TestSearchCommandsApp._open_data_file(actual, 'r') as actual:
422-
for actual_line, expected_line in zip(actual, expected):
423-
self.assertTrue(actual_line == expected_line)
415+
with TestSearchCommandsApp._open_data_file(expected, 'r') as expected:
416+
with TestSearchCommandsApp._open_data_file(actual, 'r') as actual:
417+
for actual_line, expected_line in zip(actual, expected):
418+
self.assertTrue(actual_line == expected_line)
424419
return
425420

426421
def _run(self, command, args, **kwargs):

0 commit comments

Comments
 (0)