def test_init_kedro_no_path(self, tmp_path, caplog): from kedro.extras.extensions.ipython import project_path assert project_path == tmp_path init_kedro() expected_message = f"No path argument was provided. Using: {tmp_path}" log_messages = [record.getMessage() for record in caplog.records] assert expected_message in log_messages from kedro.extras.extensions.ipython import project_path # make sure global variable stayed the same assert project_path == tmp_path
def test_init_kedro(self, tmp_path, caplog): from kedro.extras.extensions.ipython import project_path assert project_path == tmp_path kedro_path = tmp_path / "here" init_kedro(str(kedro_path)) expected_path = kedro_path.expanduser().resolve() expected_message = f"Updated path to Kedro project: {expected_path}" log_messages = [record.getMessage() for record in caplog.records] assert expected_message in log_messages from kedro.extras.extensions.ipython import project_path # make sure global variable updated assert project_path == expected_path