Skip to content

Conversation

@hroncok
Copy link
Contributor

@hroncok hroncok commented May 26, 2025

Followup for #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')

….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')
@github-actions github-actions bot added the PR: Community Contribution 👑 Community Contribution PR's label May 26, 2025
@github-actions
Copy link

Test Results

2 407 tests  ±0   2 392 ✅ ±0   22s ⏱️ -3s
    1 suites ±0      15 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit fd201d1. ± Comparison against base commit 792ab39.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Community Contribution 👑 Community Contribution PR's

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant