tests: use caplog merged in pytest 3.3 (#20321)

This commit is contained in:
Josue Kouka 2017-11-28 11:44:41 +01:00
parent ae30623210
commit 9199feed01
2 changed files with 4 additions and 5 deletions

View File

@ -266,7 +266,7 @@ def test_phantom_invalid_json(mocked_popen, caplog, user_john):
assert message.level_tag == 'error'
assert message.message == 'invalid response from server'
for record in caplog.records():
for record in caplog.records:
if record.levelname == 'ERROR':
assert record.message == 'invalid json: This is not a valid JSON'
@ -284,7 +284,7 @@ def test_phantom_js_errors(mocked_popen, caplog):
mocked_popen.return_value = MockedPopen(expected_output=expected_output)
result = exec_phantom(LOGIN_INFO)
for record in caplog.records():
for record in caplog.records:
assert record.levelname == 'WARNING'
assert record.message == "ERROR: TypeError: undefined is not a function (evaluating \'$( \"#datepicker\" )"
@ -297,7 +297,7 @@ def test_phantom_js_timeout(mocked_popen, caplog):
mocked_popen.return_value = MockedPopen(expected_output=json.dumps({'whatever': 'whatever'}), stall_for=True)
result = exec_phantom(LOGIN_INFO)
for record in caplog.records():
for record in caplog.records:
assert record.levelname == 'ERROR'
assert 'https://whatever.com' in record.message
assert 'tenants/static/js/auth.checker.js' in record.message

View File

@ -14,8 +14,7 @@ deps =
django18: django>=1.8,<1.9
pytest-cov
pytest-django
pytest
pytest-capturelog
pytest>=3.3.0
pylint
pylint-django
mock