diff options
author | Scott Talbert <swt@techie.net> | 2022-04-30 20:46:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-30 20:46:44 -0400 |
commit | 8688e19cc3788700f857c049e08c237979c4559f (patch) | |
tree | 89d7957d60166380f45df33f22279996611bc38a | |
parent | 3bed3a392905750980f0f048960122ed0666fcbd (diff) | |
parent | d47c68b1364f8a1a45ab8c584c291d44b762f7b1 (diff) | |
download | pycurl-8688e19cc3788700f857c049e08c237979c4559f.tar.gz |
Merge pull request #753 from samueloph/patch-1
tests: fix error message on error_test (for curl >= 7.83)
-rw-r--r-- | tests/error_test.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/error_test.py b/tests/error_test.py index 01d0ac5..f32b693 100644 --- a/tests/error_test.py +++ b/tests/error_test.py @@ -29,7 +29,8 @@ class ErrorTest(unittest.TestCase): err, msg = exc.args self.assertEqual(pycurl.E_URL_MALFORMAT, err) # possibly fragile - self.assertEqual('No URL set!', msg) + # curl < 7.83.0 has an exclamation mark in this error message + self.assertIn(msg, ['No URL set!', 'No URL set']) else: self.fail('Expected pycurl.error to be raised') @@ -43,9 +44,10 @@ class ErrorTest(unittest.TestCase): self.curl.perform() except pycurl.error: # might be fragile - self.assertEqual('No URL set!', self.curl.errstr()) + # curl < 7.83.0 has an exclamation mark in this error message + self.assertIn(self.curl.errstr(), ['No URL set!', 'No URL set']) # repeated checks do not clear value - self.assertEqual('No URL set!', self.curl.errstr()) + self.assertIn(self.curl.errstr(), ['No URL set!', 'No URL set']) # check the type - on all python versions self.assertEqual(str, type(self.curl.errstr())) else: |