Ignore unreachable code in test environment, we have now 99% of coverage

This commit is contained in:
Yohann D'ANELLO 2020-11-10 21:32:42 +01:00
parent 7173d13495
commit 3416ce2ac3
3 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@ class Bootstrap:
@staticmethod
def run_game():
with TermManager() as term_manager:
with TermManager() as term_manager: # pragma: no cover
game = Game()
game.new_game()
display = DisplayManager(term_manager.screen, game)

View File

@ -41,7 +41,8 @@ class DisplayManager:
If the window got resized, ensure that the screen size got updated.
"""
y, x = self.screen.getmaxyx() if self.screen else (0, 0)
if self.screen and curses.is_term_resized(self.rows, self.cols):
if self.screen and curses.is_term_resized(self.rows,
self.cols): # pragma: nocover
curses.resizeterm(y, x)
return True
return False

View File

@ -2,7 +2,7 @@ import curses
from types import TracebackType
class TermManager:
class TermManager: # pragma: no cover
def __init__(self):
self.screen = curses.initscr()
# convert escapes sequences to curses abstraction