|
4 | 4 | from collections import namedtuple |
5 | 5 | import datetime |
6 | 6 | import io |
| 7 | +import logging |
7 | 8 | import pytest |
8 | 9 | pytest.importorskip("lxml") |
9 | 10 | from lxml import etree |
|
14 | 15 | from conftest import (getConfig, gettestdata, icat_version, |
15 | 16 | get_icatdata_schema, testdatadir) |
16 | 17 |
|
| 18 | +logger = logging.getLogger(__name__) |
17 | 19 |
|
18 | 20 | def get_test_investigation(client): |
19 | 21 | query = Query(client, "Investigation", conditions={ |
@@ -560,9 +562,10 @@ def test_ingest_error_invalid(client, investigation, schemadir, case): |
560 | 562 | datasets = [] |
561 | 563 | for name in case.data: |
562 | 564 | datasets.append(client.new("Dataset", name=name)) |
563 | | - with pytest.raises(icat.InvalidIngestFileError): |
| 565 | + with pytest.raises(icat.InvalidIngestFileError) as exc: |
564 | 566 | reader = IngestReader(client, case.metadata, investigation) |
565 | 567 | reader.ingest(datasets, dry_run=True, update_ds=True) |
| 568 | + logger.info("Raised %s: %s", exc.type.__name__, exc.value) |
566 | 569 |
|
567 | 570 | searcherr_attr_metadata = NamedBytesIO("""<?xml version='1.0' encoding='UTF-8'?> |
568 | 571 | <icatingest version="1.0"> |
@@ -621,9 +624,10 @@ def test_ingest_error_searcherr(client, investigation, schemadir, case): |
621 | 624 | datasets = [] |
622 | 625 | for name in case.data: |
623 | 626 | datasets.append(client.new("Dataset", name=name)) |
624 | | - with pytest.raises(icat.SearchResultError): |
| 627 | + with pytest.raises(icat.SearchResultError) as exc: |
625 | 628 | reader = IngestReader(client, case.metadata, investigation) |
626 | 629 | reader.ingest(datasets, dry_run=True, update_ds=True) |
| 630 | + logger.info("Raised %s: %s", exc.type.__name__, exc.value) |
627 | 631 |
|
628 | 632 |
|
629 | 633 | customcases = [ |
|
0 commit comments