From e48a74b80a698952ae166fac40d5451784aff0a7 Mon Sep 17 00:00:00 2001 From: Harshal Sheth Date: Thu, 29 Apr 2021 23:18:55 -0700 Subject: [PATCH] test(ingest): add test names and IDs using pytest (#2476) --- metadata-ingestion/src/datahub/__init__.py | 1 + metadata-ingestion/tests/unit/test_airflow.py | 6 +++++- metadata-ingestion/tests/unit/test_schema_util.py | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/metadata-ingestion/src/datahub/__init__.py b/metadata-ingestion/src/datahub/__init__.py index 9410bc40a1..a88b750409 100644 --- a/metadata-ingestion/src/datahub/__init__.py +++ b/metadata-ingestion/src/datahub/__init__.py @@ -1,3 +1,4 @@ +# Published at https://pypi.org/project/acryl-datahub/. __package_name__ = "acryl-datahub" __version__ = "0.0.0.dev0" diff --git a/metadata-ingestion/tests/unit/test_airflow.py b/metadata-ingestion/tests/unit/test_airflow.py index 03a4f7bbe0..fb44064ba3 100644 --- a/metadata-ingestion/tests/unit/test_airflow.py +++ b/metadata-ingestion/tests/unit/test_airflow.py @@ -138,7 +138,7 @@ def test_hook_airflow_ui(hook): @pytest.mark.parametrize( - "inlets,outlets", + ["inlets", "outlets"], [ ( # Airflow 1.10.x uses a dictionary structure for inlets and outlets. @@ -158,6 +158,10 @@ def test_hook_airflow_ui(hook): ), ), ], + ids=[ + "airflow-1-10-x-decl", + "airflow-2-x-decl", + ], ) @mock.patch("datahub.integrations.airflow.operators.DatahubRestHook.emit_mces") def test_lineage_backend(mock_emit, inlets, outlets): diff --git a/metadata-ingestion/tests/unit/test_schema_util.py b/metadata-ingestion/tests/unit/test_schema_util.py index c0872b50c2..86c08b8d12 100644 --- a/metadata-ingestion/tests/unit/test_schema_util.py +++ b/metadata-ingestion/tests/unit/test_schema_util.py @@ -114,6 +114,11 @@ SCHEMA_WITH_DEFAULT_VALUE = """ SCHEMA_WITH_OPTIONAL_FIELD_VIA_UNION_TYPE_NULL_ISNT_FIRST_IN_UNION, SCHEMA_WITH_OPTIONAL_FIELD_VIA_PRIMITIVE_TYPE, ], + ids=[ + "optional_field_via_union_type", + "optional_field_via_union_null_not_first", + "optional_field_via_primitive", + ], ) def test_avro_schema_to_mce_fields_events_with_nullable_fields(schema): fields = avro_schema_to_mce_fields(schema)