From 07b380b88c8adbe527bd83418681e6e32aeddcb4 Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Sun, 30 Jun 2019 17:23:47 -0700 Subject: [PATCH] Fix pytest.raises compat issue --- tests/authentication/test_authentication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/authentication/test_authentication.py b/tests/authentication/test_authentication.py index 40df2cdc8..37e265e17 100644 --- a/tests/authentication/test_authentication.py +++ b/tests/authentication/test_authentication.py @@ -535,9 +535,9 @@ class BasicAuthenticationUnitTests(TestCase): authentication.authenticate = lambda **kwargs: MockUser() try: auth = authentication.BasicAuthentication() - with pytest.raises(exceptions.AuthenticationFailed) as error: + with pytest.raises(exceptions.AuthenticationFailed) as exc_info: auth.authenticate_credentials('foo', 'bar') - assert 'User inactive or deleted.' in str(error) + assert 'User inactive or deleted.' in str(exc_info.value) finally: authentication.authenticate = old_authenticate