Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python 3.12 to run_tests github workflow #1856

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
8 changes: 7 additions & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
python-version: "3.10"
- os: windows-latest
python-version: 3.11
- os: windows-latest
python-version: 3.12
- os: ubuntu-latest
python-version: 3.8
- os: ubuntu-latest
Expand All @@ -26,6 +28,8 @@ jobs:
python-version: "3.10"
- os: ubuntu-latest
python-version: 3.11
- os: ubuntu-latest
python-version: 3.12
- os: macos-latest
python-version: 3.8
- os: macos-latest
Expand All @@ -34,6 +38,8 @@ jobs:
python-version: "3.10"
- os: macos-latest
python-version: 3.11
- os: macos-latest
python-version: 3.12

steps:
- name: Checkout MPF
Expand Down Expand Up @@ -79,4 +85,4 @@ jobs:
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 1 addition & 17 deletions mpf/core/placeholder_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,7 @@ def __init__(self, machine):
"""Initialize."""
super().__init__(machine)
self._eval_methods = {
ast.Num: self._eval_num,
ast.Str: self._eval_str,
ast.NameConstant: self._eval_constant,
ast.Constant: self._eval_constant,
ast.BinOp: self._eval_bin_op,
ast.UnaryOp: self._eval_unary_op,
ast.Compare: self._eval_compare,
Expand All @@ -655,8 +653,6 @@ def __init__(self, machine):
ast.IfExp: self._eval_if,
ast.Tuple: self._eval_tuple,
}
if hasattr(ast, "Constant"):
self._eval_methods[ast.Constant] = self._eval_constant

def _eval_tuple(self, node, variables, subscribe):
return tuple([self._eval(x, variables, subscribe) for x in node.elts])
Expand All @@ -668,18 +664,6 @@ def _parse_template(template_str):
except SyntaxError:
raise AssertionError('Failed to parse template "{}"'.format(template_str))

@staticmethod
def _eval_num(node, variables, subscribe):
del variables
del subscribe
return node.n, []

@staticmethod
def _eval_str(node, variables, subscribe):
del variables
del subscribe
return node.s, []

@staticmethod
def _eval_constant(node, variables, subscribe):
del variables
Expand Down
4 changes: 2 additions & 2 deletions mpf/platforms/spike/spike.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ async def send_cmd_and_wait_for_response(self, node, cmd, data, response_len) ->
"""Send cmd and wait for response."""
assert response_len > 0
if node > 15:
raise AssertionError("Node must be 0-15.")
raise AssertionError(f"Node must be 0-15. Got: {node}")
cmd_str = bytearray()
cmd_str.append((8 << 4) + node)
cmd_str.append(len(data) + 2)
Expand Down Expand Up @@ -1134,7 +1134,7 @@ async def send_cmd_and_wait_for_response(self, node, cmd, data, response_len) ->

def _create_cmd_str(self, node, cmd, data):
if node > 15:
raise AssertionError("Node must be 0-15.")
raise AssertionError(f"Node must be 0-15. Got: {node}")
cmd_str = bytearray()
cmd_str.append((8 << 4) + node)
cmd_str.append(len(data) + 2)
Expand Down
742 changes: 371 additions & 371 deletions mpf/tests/test_Game.py

Large diffs are not rendered by default.

Loading
Loading