Skip to content

[pre-commit.ci] pre-commit autoupdate #363

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #363

GitHub Actions / JUnit Test Report failed Feb 5, 2024 in 0s

91 tests run, 89 passed, 0 skipped, 2 failed.

Annotations

Check failure on line 1 in TestCopyParamsWithGlobals

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestCopyParamsWithGlobals.test_inherits

assert ["assert 'ano...er_new_value"] == ["assert 'ano...er_new_value"]
  
  At index 0 diff: "assert 'another_new_value' == 'new_value'\n  \n  - new_value\n  + another_new_value" != "assert 'another_new_value' == 'new_value'\n  - new_value\n  + another_new_value"
  Use -v to get more diff
Raw output
self = <tests.test_task.TestCopyParamsWithGlobals object at 0x7faf0dee7090>

    def test_inherits(self):
        """Compare with luigi.util.inherits."""
    
        class TaskG(luigi.Task):
            """A simple test task."""
    
            g = luigi.Parameter(default="default_value_g")
    
            def run(self):
                assert self.g == "new_value"
    
            def output(self):
                return luigi.LocalTarget("not_existing_file")
    
        @inherits(TaskG)
        class TaskH(luigi.Task):
            """A simple test task."""
    
            h = luigi.Parameter()
    
            def requires(self):
                return self.clone(TaskG)
    
            def run(self):
                assert self.g == "another_new_value"
                assert self.h == "h_from_cfg"
    
            def output(self):
                return luigi.LocalTarget("not_existing_file")
    
        with set_luigi_config(
            {
                "TaskG": {
                    "g": "new_value",
                },
                "TaskH": {
                    "g": "another_new_value",
                    "h": "h_from_cfg",
                },
            }
        ):
            failed_task = []
            exceptions = []
    
            @TaskG.event_handler(luigi.Event.FAILURE)
            def check_exception(task, exception):
                failed_task.append(str(task))
                exceptions.append(str(exception))
    
            # The workflow fails because TaskG().g == "another_new_value" != "new_value"
            assert not luigi.build([TaskH()], local_scheduler=True)
            assert failed_task == [str(TaskG(g="another_new_value"))]
>           assert exceptions == [
                "assert 'another_new_value' == 'new_value'\n  - new_value\n  + another_new_value"
            ]
E           assert ["assert 'ano...er_new_value"] == ["assert 'ano...er_new_value"]
E             
E             At index 0 diff: "assert 'another_new_value' == 'new_value'\n  \n  - new_value\n  + another_new_value" != "assert 'another_new_value' == 'new_value'\n  - new_value\n  + another_new_value"
E             Use -v to get more diff

tests/test_task.py:480: AssertionError

Check failure on line 1 in TestSetLuigiConfig

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestSetLuigiConfig.test_new_config

assert ["assert 'a_f...+ a_from_cfg"] == ["assert 'a_f...+ a_from_cfg"]
  
  At index 0 diff: "assert 'a_from_cfg' == 'different_value'\n  \n  - different_value\n  + a_from_cfg" != "assert 'a_from_cfg' == 'different_value'\n  - different_value\n  + a_from_cfg"
  Use -v to get more diff
Raw output
self = <tests.test_util.TestSetLuigiConfig object at 0x7faf0dd67c90>
Task = <class 'tests.test_util.TestSetLuigiConfig.Task.<locals>.Task'>

    def test_new_config(self, Task):
        """Test with new config."""
        with set_luigi_config(
            {
                "Task": {"a": "a_from_cfg"},
            }
        ):
            assert luigi.build([Task(expected_a="a_from_cfg")], local_scheduler=True)
    
        failed_task = []
        exceptions = []
    
        @Task.event_handler(luigi.Event.FAILURE)
        def check_exception(task, exception):
            failed_task.append(str(task))
            exceptions.append(str(exception))
    
        with set_luigi_config(
            {
                "Task": {"a": "a_from_cfg"},
            }
        ):
            assert not luigi.build([Task(expected_a="different_value")], local_scheduler=True)
    
        assert failed_task == [str(Task(a="a_from_cfg", expected_a="different_value"))]
>       assert exceptions == [
            "assert 'a_from_cfg' == 'different_value'\n  - different_value\n  + a_from_cfg"
        ]
E       assert ["assert 'a_f...+ a_from_cfg"] == ["assert 'a_f...+ a_from_cfg"]
E         
E         At index 0 diff: "assert 'a_from_cfg' == 'different_value'\n  \n  - different_value\n  + a_from_cfg" != "assert 'a_from_cfg' == 'different_value'\n  - different_value\n  + a_from_cfg"
E         Use -v to get more diff

tests/test_util.py:500: AssertionError