Skip to content

Commit 7f824e2

Browse files
committed
Applied a few more fixes
1 parent 6d00a49 commit 7f824e2

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

tests/test_history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ def test_history_output_file():
668668
run_cmd(app, 'history -o "{}"'.format(fname))
669669
assert app.last_result is True
670670

671-
expected = normalize('\n'.join(['help', 'shortcuts', 'help history', 'alias create my_alias history;']))
671+
expected = normalize('help\nshortcuts\nhelp history\nalias create my_alias history;')
672672
with open(fname) as f:
673673
content = normalize(f.read())
674674
assert content == expected

tests/test_table_creator.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def test_wrap_long_word():
230230
'Name Col 2 ')
231231

232232
# Test data row
233-
row_data = list()
233+
row_data = []
234234

235235
# Long word should start on the first line (style should not affect width)
236236
row_data.append(ansi.style("LongerThan10", fg=Fg.GREEN))
@@ -267,7 +267,7 @@ def test_wrap_long_word_max_data_lines():
267267
columns = [column_1, column_2, column_3, column_4]
268268
tc = TableCreator(columns)
269269

270-
row_data = list()
270+
row_data = []
271271

272272
# This long word will exactly fit the last line and it's the final word in the text. No ellipsis should appear.
273273
row_data.append("LongerThan10FitsLast")
@@ -341,7 +341,7 @@ def test_simple_table_creation():
341341
column_1 = Column("Col 1", width=16)
342342
column_2 = Column("Col 2", width=16)
343343

344-
row_data = list()
344+
row_data = []
345345
row_data.append(["Col 1 Row 1", "Col 2 Row 1"])
346346
row_data.append(["Col 1 Row 2", "Col 2 Row 2"])
347347

@@ -495,7 +495,7 @@ def test_simple_table_width():
495495
column_1 = Column("Col 1", width=16)
496496
column_2 = Column("Col 2", width=16)
497497

498-
row_data = list()
498+
row_data = []
499499
row_data.append(["Col 1 Row 1", "Col 2 Row 1"])
500500
row_data.append(["Col 1 Row 2", "Col 2 Row 2"])
501501

@@ -518,7 +518,7 @@ def test_bordered_table_creation():
518518
column_1 = Column("Col 1", width=15)
519519
column_2 = Column("Col 2", width=15)
520520

521-
row_data = list()
521+
row_data = []
522522
row_data.append(["Col 1 Row 1", "Col 2 Row 1"])
523523
row_data.append(["Col 1 Row 2", "Col 2 Row 2"])
524524

@@ -637,7 +637,7 @@ def test_bordered_table_width():
637637
column_1 = Column("Col 1", width=15)
638638
column_2 = Column("Col 2", width=15)
639639

640-
row_data = list()
640+
row_data = []
641641
row_data.append(["Col 1 Row 1", "Col 2 Row 1"])
642642
row_data.append(["Col 1 Row 2", "Col 2 Row 2"])
643643

@@ -660,7 +660,7 @@ def test_alternating_table_creation():
660660
column_1 = Column("Col 1", width=15)
661661
column_2 = Column("Col 2", width=15)
662662

663-
row_data = list()
663+
row_data = []
664664
row_data.append(["Col 1 Row 1", "Col 2 Row 1"])
665665
row_data.append(["Col 1 Row 2", "Col 2 Row 2"])
666666

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def pr_none():
272272

273273
# Start a long running process so we have time to run tests on it before it finishes
274274
# Put the new process into a separate group so its signal are isolated from ours
275-
kwargs = dict()
275+
kwargs = {}
276276
if sys.platform.startswith('win'):
277277
command = 'timeout -t 5 /nobreak'
278278
kwargs['creationflags'] = subprocess.CREATE_NEW_PROCESS_GROUP

tests_isolated/test_commandset/test_commandset.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,10 +1100,10 @@ def __init__(self):
11001100

11011101
# verify the settable shows up
11021102
out, err = run_cmd(app, 'set')
1103-
any(['arbitrary_value' in line and '5' in line for line in out])
1103+
any('arbitrary_value' in line and '5' in line for line in out)
11041104

11051105
out, err = run_cmd(app, 'set arbitrary_value')
1106-
any(['arbitrary_value' in line and '5' in line for line in out])
1106+
any('arbitrary_value' in line and '5' in line for line in out)
11071107

11081108
# change the value and verify the value changed
11091109
out, err = run_cmd(app, 'set arbitrary_value 10')
@@ -1113,7 +1113,7 @@ def __init__(self):
11131113
"""
11141114
assert out == normalize(expected)
11151115
out, err = run_cmd(app, 'set arbitrary_value')
1116-
any(['arbitrary_value' in line and '10' in line for line in out])
1116+
any('arbitrary_value' in line and '10' in line for line in out)
11171117

11181118
# can't add to cmd2 now because commandset already has this settable
11191119
with pytest.raises(KeyError):
@@ -1172,10 +1172,10 @@ def __init__(self):
11721172
assert 'some.arbitrary_value' in app.settables.keys()
11731173

11741174
out, err = run_cmd(app, 'set')
1175-
any(['some.arbitrary_value' in line and '5' in line for line in out])
1175+
any('some.arbitrary_value' in line and '5' in line for line in out)
11761176

11771177
out, err = run_cmd(app, 'set some.arbitrary_value')
1178-
any(['some.arbitrary_value' in line and '5' in line for line in out])
1178+
any('some.arbitrary_value' in line and '5' in line for line in out)
11791179

11801180
# verify registering a commandset with duplicate prefix and settable names fails
11811181
with pytest.raises(CommandSetRegistrationError):

0 commit comments

Comments
 (0)