Test controlling output with the ``verbose`` argument.
(capsys, n_jobs, verbose)
| 297 | "n_jobs, verbose", [(1, False), (2, False), (1, True), (2, "info")] |
| 298 | ) |
| 299 | def test_verbose_arg(capsys, n_jobs, verbose): |
| 300 | """Test controlling output with the ``verbose`` argument.""" |
| 301 | X, y = make_data() |
| 302 | clf = SVC() |
| 303 | |
| 304 | # shows progress bar and prints other messages to the console |
| 305 | with use_log_level(True): |
| 306 | for estimator_object in [SlidingEstimator, GeneralizingEstimator]: |
| 307 | estimator = estimator_object(clf, n_jobs=n_jobs, verbose=verbose) |
| 308 | estimator = estimator.fit(X, y) |
| 309 | estimator.score(X, y) |
| 310 | estimator.predict(X) |
| 311 | |
| 312 | stdout, stderr = capsys.readouterr() |
| 313 | if isinstance(verbose, bool) and not verbose: |
| 314 | assert all(channel == "" for channel in (stdout, stderr)) |
| 315 | else: |
| 316 | assert any(len(channel) > 0 for channel in (stdout, stderr)) |
| 317 | |
| 318 | |
| 319 | def test_cross_val_predict(): |
nothing calls this directly
no test coverage detected