mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 15:03:02 +00:00
scaffolding for testing version checking
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
mock
|
||||
codecov
|
||||
cryptography
|
||||
pytest-catchlog
|
||||
pytest-cov
|
||||
pytest-tornado
|
||||
pytest>=2.8
|
||||
|
20
jupyterhub/tests/test_version.py
Normal file
20
jupyterhub/tests/test_version.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""Test version checking"""
|
||||
import logging
|
||||
|
||||
import pytest
|
||||
|
||||
from .._version import _check_version
|
||||
|
||||
|
||||
@pytest.mark.parametrize('hub_version, singleuser_version, log_level, msg', [
|
||||
('0.8.0', '0.8.0', logging.DEBUG, 'both on version'),
|
||||
])
|
||||
def test_check_version(hub_version, singleuser_version, log_level, msg, caplog):
|
||||
log = logging.getLogger()
|
||||
caplog.set_level(logging.DEBUG)
|
||||
_check_version(hub_version, singleuser_version, log)
|
||||
assert len(caplog.records) == 1
|
||||
record = caplog.records[0]
|
||||
assert record.levelno == log_level
|
||||
assert msg in record.getMessage()
|
||||
|
Reference in New Issue
Block a user