|
| 1 | +import logging |
| 2 | + |
1 | 3 | import pandas as pd |
2 | 4 | import pytest |
3 | 5 |
|
@@ -75,19 +77,21 @@ def test_test_is_valid_catalog(small_sky_object_catalog, wrong_files_and_rows_di |
75 | 77 | assert not passed, "bad catalog passed" |
76 | 78 |
|
77 | 79 |
|
78 | | -def test_test_is_valid_collection(test_data_dir, tmp_path, capsys): |
| 80 | +def test_test_is_valid_collection(test_data_dir, tmp_path, caplog, capsys): |
79 | 81 | """`hats.is_valid_catalog` should pass for good catalogs, fail for catalogs without ancillary files.""" |
| 82 | + caplog.at_level(logging.INFO) |
80 | 83 | args = VerificationArguments( |
81 | 84 | input_catalog_path=test_data_dir / "small_sky_collection", output_path=tmp_path, verbose=True |
82 | 85 | ) |
83 | 86 | verifier = runner.run(args) |
84 | 87 | passed = verifier.test_is_valid_catalog() |
85 | 88 | assert passed, "good catalog failed" |
86 | | - captured = capsys.readouterr().out |
87 | | - assert "Starting: Test hats.io.validation.is_valid_collection." in captured |
88 | | - assert "Validating collection at path" in captured |
89 | | - assert "Validating catalog at path" in captured |
90 | | - assert "Result: PASSED" in captured |
| 89 | + captured_logs = caplog.text |
| 90 | + captured_stdout = capsys.readouterr().out |
| 91 | + assert "Starting: Test hats.io.validation.is_valid_collection." in captured_stdout |
| 92 | + assert "Validating collection at path" in captured_logs |
| 93 | + assert "Validating catalog at path" in captured_logs |
| 94 | + assert "Result: PASSED" in captured_stdout |
91 | 95 |
|
92 | 96 |
|
93 | 97 | def test_test_num_rows(small_sky_object_catalog, wrong_files_and_rows_dir, tmp_path): |
|
0 commit comments