From b4f012799b166552b7afa23b83ae34962b530f99 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Fri, 1 Dec 2017 00:46:29 -0800 Subject: [PATCH] More idiomatic way of checking if all items on a list are same --- tests/memlimit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/memlimit.py b/tests/memlimit.py index 9a78141e..c830cb4a 100644 --- a/tests/memlimit.py +++ b/tests/memlimit.py @@ -96,4 +96,5 @@ def test_memlimit_same_postbuild(): for fp in filepaths: with open(fp) as f: file_contents.append(f.read()) - assert all(c == file_contents[0] for c in file_contents) + # Make sure they're all the same + assert len(set(file_contents)) == 1