mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-12 12:32:58 +00:00
Rename test file test_python -> test_python_version
This commit is contained in:
24
tests/docker-stacks-foundation/test_python_version.py
Normal file
24
tests/docker-stacks-foundation/test_python_version.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
import logging
|
||||
|
||||
from tests.conftest import TrackedContainer
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
EXPECTED_PYTHON_VERSION = "3.11"
|
||||
|
||||
|
||||
def test_python_version(container: TrackedContainer) -> None:
|
||||
LOGGER.info(
|
||||
f"Checking that python major.minor version is {EXPECTED_PYTHON_VERSION}"
|
||||
)
|
||||
logs = container.run_and_wait(
|
||||
timeout=5,
|
||||
tty=True,
|
||||
command=["python", "--version"],
|
||||
)
|
||||
assert logs.startswith("Python ")
|
||||
full_version = logs.split()[1]
|
||||
major_minor_version = full_version[: full_version.rfind(".")]
|
||||
|
||||
assert major_minor_version == EXPECTED_PYTHON_VERSION
|
Reference in New Issue
Block a user