Tests for ext.load call arguments.
| 262 | |
| 263 | |
| 264 | class TestExtLoad: |
| 265 | """Tests for ext.load call arguments.""" |
| 266 | |
| 267 | def test_load_called_with_correct_name(self, tmp_path): |
| 268 | (tmp_path / "k.cu").write_text("") |
| 269 | (tmp_path / "benchmark_kernel.so").write_bytes(b"fake") |
| 270 | mock = _exec_build_ext(tmp_path) |
| 271 | assert mock.load.call_args.kwargs["name"] == "benchmark_kernel" |
| 272 | |
| 273 | def test_build_directory_is_cwd(self, tmp_path): |
| 274 | (tmp_path / "k.cu").write_text("") |
| 275 | (tmp_path / "benchmark_kernel.so").write_bytes(b"fake") |
| 276 | mock = _exec_build_ext(tmp_path) |
| 277 | assert mock.load.call_args.kwargs["build_directory"] == str(tmp_path) |
| 278 | |
| 279 | def test_verbose_enabled(self, tmp_path): |
| 280 | (tmp_path / "k.cu").write_text("") |
| 281 | (tmp_path / "benchmark_kernel.so").write_bytes(b"fake") |
| 282 | mock = _exec_build_ext(tmp_path) |
| 283 | assert mock.load.call_args.kwargs["verbose"] is True |
nothing calls this directly
no outgoing calls
no test coverage detected