From 76c258ceb0338242ee7ea543a403491bb21f33ec Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Sun, 22 Jan 2023 20:32:17 -0700 Subject: [PATCH] Fix testing of strerror to use actual valid errno/strerror to compare Closes #395 --- tests/test_wasyncore.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_wasyncore.py b/tests/test_wasyncore.py index e833c7ed..6fbadab4 100644 --- a/tests/test_wasyncore.py +++ b/tests/test_wasyncore.py @@ -1196,7 +1196,9 @@ def _callFUT(self, err): return _strerror(err) def test_gardenpath(self): - self.assertEqual(self._callFUT(1), "Operation not permitted") + from errno import EINVAL + from os import strerror + self.assertEqual(self._callFUT(EINVAL), strerror(EINVAL)) def test_unknown(self): self.assertEqual(self._callFUT("wut"), "Unknown error wut")