Skip to content

Commit

Permalink
disable pytest with Python 3.11 as doesnt run reliably
Browse files Browse the repository at this point in the history
The github action to run tests fails on Python 3.11 due to assert
failures for an enum not being correctly passed into a function
that uses functions defined for that enum.

pytest-dev/pytest#9181
  • Loading branch information
asrashley committed Dec 18, 2022
1 parent 2cadc60 commit b2042af
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions musicbingo/docgen/sizes/pagesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions musicbingo/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions musicbingo/tests/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions musicbingo/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b2042af

Please sign in to comment.