diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 066d147cd..fc75c0e60 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -62,10 +62,6 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install -r dev-requirements.txt - - name: Test with pytest - run: | - pip install pytest - pytest - name: Static type check with mypy run: | pip install mypy==0.991 diff --git a/musicbingo/docgen/sizes/pagesize.py b/musicbingo/docgen/sizes/pagesize.py index 164282a5d..cac7b7e13 100644 --- a/musicbingo/docgen/sizes/pagesize.py +++ b/musicbingo/docgen/sizes/pagesize.py @@ -116,6 +116,7 @@ class PageSizes(Enum): def width(self) -> Dimension: """get width (in mm)""" #pylint: disable=no-member + assert isinstance(self.value, Size) return Dimension(self.value.width) def height(self) -> Dimension: diff --git a/musicbingo/generator.py b/musicbingo/generator.py index 65e9f14ba..674a1e83e 100644 --- a/musicbingo/generator.py +++ b/musicbingo/generator.py @@ -484,6 +484,7 @@ def render_bingo_ticket_to_container(self, card: BingoTicket, page: int, def generate_track_listing(self, tracks: List[Track]) -> None: """generate a PDF version of the track order in the game""" assert len(tracks) > 0 + assert isinstance(self.options.page_size, PageSizes) doc = DG.Document(self.options.page_size, topMargin="0.25in", bottomMargin="0.25in", diff --git a/musicbingo/tests/test_generator.py b/musicbingo/tests/test_generator.py index 0669e86e3..35ad25028 100644 --- a/musicbingo/tests/test_generator.py +++ b/musicbingo/tests/test_generator.py @@ -165,6 +165,7 @@ def check_bingo_game_pipeline(self, page_size: PageSizes, cards_per_page: int, mrand = MockRandom() mock_randbelow.side_effect = mrand.randbelow mock_shuffle.side_effect = mrand.shuffle + self.assertIsInstance(page_size, PageSizes) opts = Options( game_id='test-pipeline', games_dest=str(self.tmpdir), diff --git a/musicbingo/tests/test_models.py b/musicbingo/tests/test_models.py index 38f0c52b0..412274a7d 100644 --- a/musicbingo/tests/test_models.py +++ b/musicbingo/tests/test_models.py @@ -30,9 +30,9 @@ DatabaseOptions.DEFAULT_FILENAME = None Options.INI_FILENAME = None -class TestOptions(Options): +class ClipOptions(Options): """ - Wrapper around Options + Wrapper around Options that modifies clip location """ def clips(self) -> Path: """Return directory containing song clips""" @@ -61,7 +61,7 @@ class TestDatabaseModels(ModelsUnitTest): def setUp(self): """called before each test""" db_opts = DatabaseOptions(database_provider='sqlite', database_name=':memory:') - self.options = TestOptions(clip_directory="/home/bingo/Clips", database=db_opts) + self.options = ClipOptions(clip_directory="/home/bingo/Clips", database=db_opts) # self.options.exists = False logging.getLogger().setLevel(logging.ERROR)