|
19 | 19 | from airflow_breeze.utils.confirm import Answer |
20 | 20 |
|
21 | 21 |
|
22 | | -def test_generate_constraints_forwards_allow_missing_previous_constraints_file(monkeypatch): |
| 22 | +def test_generate_constraints_enables_bootstrap_flags_for_python_3_14(monkeypatch): |
23 | 23 | import airflow_breeze.commands.release_management_commands as module |
24 | 24 |
|
25 | 25 | captured_shell_params = {} |
@@ -50,3 +50,38 @@ def fake_run_generate_constraints(shell_params, output): |
50 | 50 | ) |
51 | 51 |
|
52 | 52 | assert captured_shell_params["value"].allow_missing_previous_constraints_file is True |
| 53 | + assert captured_shell_params["value"].airflow_fallback_no_constraints_installation is True |
| 54 | + |
| 55 | + |
| 56 | +def test_generate_constraints_keeps_no_constraints_fallback_disabled_for_older_python(monkeypatch): |
| 57 | + import airflow_breeze.commands.release_management_commands as module |
| 58 | + |
| 59 | + captured_shell_params = {} |
| 60 | + |
| 61 | + monkeypatch.setattr(module, "perform_environment_checks", lambda: None) |
| 62 | + monkeypatch.setattr(module, "check_remote_ghcr_io_commands", lambda: None) |
| 63 | + monkeypatch.setattr(module, "fix_ownership_using_docker", lambda: None) |
| 64 | + monkeypatch.setattr(module, "cleanup_python_generated_files", lambda: None) |
| 65 | + monkeypatch.setattr(module, "user_confirm", lambda *args, **kwargs: Answer.YES) |
| 66 | + |
| 67 | + def fake_run_generate_constraints(shell_params, output): |
| 68 | + captured_shell_params["value"] = shell_params |
| 69 | + return 0, "constraints-source-providers:3.13" |
| 70 | + |
| 71 | + monkeypatch.setattr(module, "run_generate_constraints", fake_run_generate_constraints) |
| 72 | + |
| 73 | + module.generate_constraints.callback( |
| 74 | + airflow_constraints_mode="constraints-source-providers", |
| 75 | + allow_missing_previous_constraints_file=True, |
| 76 | + debug_resources=False, |
| 77 | + github_repository="apache/airflow", |
| 78 | + parallelism=1, |
| 79 | + python="3.13", |
| 80 | + python_versions="3.13", |
| 81 | + run_in_parallel=False, |
| 82 | + skip_cleanup=False, |
| 83 | + use_uv=True, |
| 84 | + ) |
| 85 | + |
| 86 | + assert captured_shell_params["value"].allow_missing_previous_constraints_file is True |
| 87 | + assert captured_shell_params["value"].airflow_fallback_no_constraints_installation is False |
0 commit comments