Projet

Général

Profil

« Précédent | Suivant » 

Révision 9199feed

Ajouté par Josué Kouka il y a plus de 6 ans

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

Voir les différences:

tests/test_mandayejs.py
266 266
        assert message.level_tag == 'error'
267 267
        assert message.message == 'invalid response from server'
268 268

  
269
    for record in caplog.records():
269
    for record in caplog.records:
270 270
        if record.levelname == 'ERROR':
271 271
            assert record.message == 'invalid json: This is not a valid JSON'
272 272

  
......
284 284
    mocked_popen.return_value = MockedPopen(expected_output=expected_output)
285 285
    result = exec_phantom(LOGIN_INFO)
286 286

  
287
    for record in caplog.records():
287
    for record in caplog.records:
288 288
        assert record.levelname == 'WARNING'
289 289
        assert record.message == "ERROR: TypeError: undefined is not a function (evaluating \'$( \"#datepicker\" )"
290 290

  
......
297 297
    mocked_popen.return_value = MockedPopen(expected_output=json.dumps({'whatever': 'whatever'}), stall_for=True)
298 298
    result = exec_phantom(LOGIN_INFO)
299 299

  
300
    for record in caplog.records():
300
    for record in caplog.records:
301 301
        assert record.levelname == 'ERROR'
302 302
        assert 'https://whatever.com' in record.message
303 303
        assert 'tenants/static/js/auth.checker.js' in record.message
tox.ini
14 14
  django18: django>=1.8,<1.9
15 15
  pytest-cov
16 16
  pytest-django
17
  pytest
18
  pytest-capturelog
17
  pytest>=3.3.0
19 18
  pylint
20 19
  pylint-django
21 20
  mock

Formats disponibles : Unified diff