mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-10 11:32:57 +00:00
Update conftest.py
This commit is contained in:
12
conftest.py
12
conftest.py
@@ -108,12 +108,16 @@ class TrackedContainer:
|
|||||||
return logs
|
return logs
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_warnings(logs: str) -> list[str]:
|
def get_errors(logs: str) -> list[str]:
|
||||||
return [line for line in logs.split("\n") if line.startswith("WARNING")]
|
return _lines_starting_with(logs, "ERROR")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_errors(logs: str) -> list[str]:
|
def get_warnings(logs: str) -> list[str]:
|
||||||
return [line for line in logs.split("\n") if line.startswith("ERROR")]
|
return _lines_starting_with(logs, "WARNING")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _lines_starting_with(logs: str, pattern: str) -> list[str]:
|
||||||
|
return [line for line in logs.splitlines() if line.startswith(pattern)]
|
||||||
|
|
||||||
def remove(self):
|
def remove(self):
|
||||||
"""Kills and removes the tracked docker container."""
|
"""Kills and removes the tracked docker container."""
|
||||||
|
Reference in New Issue
Block a user