diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py index cb4234b5e59..306296fe84e 100644 --- a/Lib/test/test_crypt.py +++ b/Lib/test/test_crypt.py @@ -25,7 +25,10 @@ def test_saltedcrypt(self): self.assertEqual(len(pw), method.total_size) def test_methods(self): - self.assertTrue(len(crypt.methods()) > 1) + # Gurantee that METHOD_CRYPT is the last method in crypt.methods(). + methods = crypt.methods() + self.assertTrue(len(methods) >= 1) + self.assertEqual(crypt.METHOD_CRYPT, methods[-1]) def test_main(): support.run_unittest(CryptTestCase)