Access ast.Constant.value, not .s -- the latter is gone from Python 3.14+#997
Open
hroncok wants to merge 1 commit intoUltimaker:mainfrom
Open
Access ast.Constant.value, not .s -- the latter is gone from Python 3.14+#997hroncok wants to merge 1 commit intoUltimaker:mainfrom
hroncok wants to merge 1 commit intoUltimaker:mainfrom
Conversation
….14+ Followup for Ultimaker#498 Test failures this fixes: _____________________________ test_init_good["x"] ______________________________ setting_function_good = <UM.Settings.SettingFunction (0x7f36b42aa200) ="x" > def test_init_good(setting_function_good): assert setting_function_good is not None > assert setting_function_good.isValid() E assert False E + where False = isValid() E + where isValid = <UM.Settings.SettingFunction (0x7f36b42aa200) ="x" >.isValid tests/Settings/TestSettingFunction.py:64: AssertionError ---------------------------- Captured stdout setup ----------------------------- [MainThread] UM.Settings.SettingFunction._safeCompile [80]: Exception in function ('Constant' object has no attribute 's') for setting: "x" _______________________________ test_call[data1] _______________________________ data = {'code': '"x"', 'result': 'x'} @pytest.mark.parametrize("data", test_call_data) def test_call(data): value_provider = MockValueProvider() function = SettingFunction(data["code"]) > assert function(value_provider) == data["result"] E assert None == 'x' E + where None = <UM.Settings.SettingFunction (0x7f36be9e57f0) ="x" >(<tests.Settings.TestSettingFunction.MockValueProvider object at 0x7f36c0f27250>) tests/Settings/TestSettingFunction.py:115: AssertionError ----------------------------- Captured stdout call ----------------------------- [MainThread] UM.Settings.SettingFunction._safeCompile [80]: Exception in function ('Constant' object has no attribute 's') for setting: "x" _________________________ test_getUsedSettings[data1] __________________________ data = {'code': '"x"', 'variables': ['x']} @pytest.mark.parametrize("data", test_getUsedSettings_data) def test_getUsedSettings(data): function = SettingFunction(data["code"]) answer = function.getUsedSettingKeys() > assert len(answer) == len(data["variables"]) E AssertionError: assert 0 == 1 E + where 0 = len(frozenset()) E + and 1 = len(['x']) tests/Settings/TestSettingFunction.py:159: AssertionError ----------------------------- Captured stdout call ----------------------------- [MainThread] UM.Settings.SettingFunction._safeCompile [80]: Exception in function ('Constant' object has no attribute 's') for setting: "x" _________________________ test_getUsedSettings[data7] __________________________ data = {'code': "sqrt('x')", 'variables': ['x']} @pytest.mark.parametrize("data", test_getUsedSettings_data) def test_getUsedSettings(data): function = SettingFunction(data["code"]) answer = function.getUsedSettingKeys() > assert len(answer) == len(data["variables"]) E AssertionError: assert 0 == 1 E + where 0 = len(frozenset()) E + and 1 = len(['x']) tests/Settings/TestSettingFunction.py:159: AssertionError ----------------------------- Captured stdout call ----------------------------- [MainThread] UM.Settings.SettingFunction._safeCompile [80]: Exception in function ('Constant' object has no attribute 's') for setting: sqrt('x')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Followup for #498
Test failures this fixes: