# HG changeset patch # User Thomas De Schampheleire # Date 1463252052 -7200 # Node ID 151459ea3bd1b97fc7855443120ff8a14f6fd1ec # Parent be1d366f461c0c1a8e15ef2a6bff08dde5aab33d pytest migration: __init__: switch to standard assert statements Use unittest2pytest to replace unittest-style assert statements (e.g. assertEqual) with standard Python assert statements to benefit from pytest's improved reporting on assert failures. The conversion by unittest2pytest was correct. diff -r be1d366f461c -r 151459ea3bd1 kallithea/tests/__init__.py --- a/kallithea/tests/__init__.py Sat May 14 21:04:26 2016 +0200 +++ b/kallithea/tests/__init__.py Sat May 14 20:54:12 2016 +0200 @@ -198,7 +198,7 @@ if 'Invalid username or password' in response.body: pytest.fail('could not login using %s %s' % (username, password)) - self.assertEqual(response.status, '302 Found') + assert response.status == '302 Found' self.assert_authenticated_user(response, username) response = response.follow() @@ -212,7 +212,7 @@ user = cookie and cookie.get('user_id') user = user and User.get(user) user = user and user.username - self.assertEqual(user, expected_username) + assert user == expected_username def authentication_token(self): return self.app.get(url('authentication_token')).body