diff --git a/pyproject.toml b/pyproject.toml index 798006d22..9006d32fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ keywords = "raiden, raiden-network" [tool.flit.metadata.requires-extra] # Extended dependencies required for development and testing. Flit installs # these automatically. -test = ["pytest", "tox"] +test = ["pytest==4.5.0", "tox"] dev = [ "black==19.3b0", "flake8-bugbear==18.8.0", diff --git a/scenario_player/main.py b/scenario_player/main.py index bfa9c1373..5e3781e77 100644 --- a/scenario_player/main.py +++ b/scenario_player/main.py @@ -29,7 +29,7 @@ from scenario_player.runner import ScenarioRunner from scenario_player.services.common.app import ServiceProcess from scenario_player.tasks.base import collect_tasks -from scenario_player.ui import ScenarioUI, enable_gui_formatting +from scenario_player.ui import ScenarioUI, attach_urwid_logbuffer from scenario_player.utils import ( ChainConfigType, DummyStream, @@ -153,7 +153,7 @@ def run( # If the output is a terminal, beautify our output. if enable_ui: - enable_gui_formatting() + log_buffer = attach_urwid_logbuffer() # Dynamically import valid Task classes from sceanrio_player.tasks package. collect_tasks(tasks) diff --git a/scenario_player/ui.py b/scenario_player/ui.py index f81025e61..64942316b 100644 --- a/scenario_player/ui.py +++ b/scenario_player/ui.py @@ -285,7 +285,7 @@ def set_success(self, success): self._loop.screen.register_palette_entry("focus", "dark red", "default") -def enable_gui_formatting(): +def attach_urwid_logbuffer(): """Enable formatted text output for the console UI.""" log_buffer = UrwidLogWalker([]) for handler in logging.getLogger("").handlers: @@ -296,3 +296,4 @@ def enable_gui_formatting(): ) handler.stream = log_buffer break + return log_buffer