From 5af43fbae1374ffa6ce8fa20d00b4169570f4b13 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Sat, 13 May 2017 15:59:13 +0100 Subject: [PATCH] Fix test not to expect notebooks sorted PR gh-2281 removed the sorting step from the server. This can result in non-deterministic test failures, because the test checked against a list. --- notebook/services/contents/tests/test_contents_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebook/services/contents/tests/test_contents_api.py b/notebook/services/contents/tests/test_contents_api.py index 439dffdfa..990b6ca51 100644 --- a/notebook/services/contents/tests/test_contents_api.py +++ b/notebook/services/contents/tests/test_contents_api.py @@ -249,8 +249,8 @@ class APITest(NotebookTestBase): self.assertEqual(nbnames, expected) nbs = notebooks_only(self.api.list('ordering').json()) - nbnames = [n['name'] for n in nbs] - expected = ['A.ipynb', 'b.ipynb', 'C.ipynb'] + nbnames = {n['name'] for n in nbs} + expected = {'A.ipynb', 'b.ipynb', 'C.ipynb'} self.assertEqual(nbnames, expected) def test_list_dirs(self):