1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Fix tests broken by recent pytest upgrades

This commit is contained in:
Julien Duponchelle 2017-01-17 18:56:06 +01:00
parent 82da073dd7
commit 28cbae546d
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
2 changed files with 11 additions and 12 deletions

View File

@ -3,6 +3,5 @@
sphinx==1.5.1
pytest==3.0.5
pep8==1.7.0
pytest-capturelog==0.7
pytest-cov==2.4.0
pytest-catchlog==1.2.2
pytest-timeout==1.2.0

View File

@ -24,27 +24,27 @@ def test_init_logger(caplog):
logger = init_logger(logging.DEBUG)
logger.debug("DEBUG1")
assert "DEBUG1" in caplog.text()
assert "DEBUG1" in caplog.text
logger.info("INFO1")
assert "INFO1" in caplog.text()
assert "INFO1" in caplog.text
logger.warn("WARN1")
assert "WARN1" in caplog.text()
assert "WARN1" in caplog.text
logger.error("ERROR1")
assert "ERROR1" in caplog.text()
assert "ERROR1" in caplog.text
logger.critical("CRITICAL1")
assert "CRITICAL1" in caplog.text()
assert "CRITICAL1" in caplog.text
def test_init_logger_quiet(caplog):
logger = init_logger(logging.DEBUG, quiet=True)
logger.debug("DEBUG1")
assert "DEBUG1" not in caplog.text()
assert "DEBUG1" not in caplog.text
logger.info("INFO1")
assert "INFO1" not in caplog.text()
assert "INFO1" not in caplog.text
logger.warn("WARN1")
assert "WARN1" not in caplog.text()
assert "WARN1" not in caplog.text
logger.error("ERROR1")
assert "ERROR1" not in caplog.text()
assert "ERROR1" not in caplog.text
logger.critical("CRITICAL1")
assert "CRITICAL1" not in caplog.text()
assert "CRITICAL1" not in caplog.text