From 5a5c58cb6eda22ee7fbcdac916f655c29a731a76 Mon Sep 17 00:00:00 2001 From: Robert Segal Date: Thu, 2 Apr 2026 07:51:47 -0600 Subject: [PATCH] Enabled skipped catalog e2e tests --- tests/e2e/catalog/items/test_async_item.py | 6 +++--- tests/e2e/catalog/items/test_sync_item.py | 6 +++--- .../catalog/product/documents/test_async_document.py | 8 +++----- .../catalog/product/documents/test_sync_document.py | 8 +++----- tests/e2e/catalog/product/test_async_product.py | 12 ++++-------- tests/e2e/catalog/product/test_sync_product.py | 12 ++++-------- .../units_of_measure/test_async_units_of_measure.py | 1 - .../units_of_measure/test_sync_units_of_measure.py | 1 - 8 files changed, 20 insertions(+), 34 deletions(-) diff --git a/tests/e2e/catalog/items/test_async_item.py b/tests/e2e/catalog/items/test_async_item.py index 9f9a4c89..f8427773 100644 --- a/tests/e2e/catalog/items/test_async_item.py +++ b/tests/e2e/catalog/items/test_async_item.py @@ -32,13 +32,13 @@ async def test_update_item(async_mpt_vendor, async_created_item): assert result.name == "e2e - delete me (updated)" -@pytest.mark.skip(reason="Leaves test items in the catalog") async def test_review_and_publish_item(async_mpt_vendor, async_mpt_ops, async_created_item): item = await async_mpt_vendor.catalog.items.review(async_created_item.id) assert item.status == "Pending" - item = await async_mpt_ops.catalog.items.publish(async_created_item.id) - assert item.status == "Published" + result = await async_mpt_ops.catalog.items.publish(async_created_item.id) + + assert result.status == "Published" async def test_get_item(async_mpt_vendor, item_id): diff --git a/tests/e2e/catalog/items/test_sync_item.py b/tests/e2e/catalog/items/test_sync_item.py index 3f70e678..10d64fbe 100644 --- a/tests/e2e/catalog/items/test_sync_item.py +++ b/tests/e2e/catalog/items/test_sync_item.py @@ -32,13 +32,13 @@ def test_update_item(mpt_vendor, created_item): assert result.name == "please delete me" -@pytest.mark.skip(reason="Leaves test items in the catalog") # noqa: AAA01 def test_review_and_publish_item(mpt_vendor, mpt_ops, created_item): item = mpt_vendor.catalog.items.review(created_item.id) assert item.status == "Pending" - item = mpt_ops.catalog.items.publish(created_item.id) - assert item.status == "Published" + result = mpt_ops.catalog.items.publish(created_item.id) + + assert result.status == "Published" def test_get_item(mpt_vendor, item_id): diff --git a/tests/e2e/catalog/product/documents/test_async_document.py b/tests/e2e/catalog/product/documents/test_async_document.py index 4524fb5c..7c27da6d 100644 --- a/tests/e2e/catalog/product/documents/test_async_document.py +++ b/tests/e2e/catalog/product/documents/test_async_document.py @@ -81,21 +81,19 @@ async def test_filter_documents_async(async_document_service, created_document_f assert documents[0].id == created_document_from_file_async.id -@pytest.mark.skip(reason="Leaves test documents in published state") async def test_review_and_publish_document_async( async_mpt_vendor, async_mpt_ops, created_document_from_file_async, product_id ): vendor_service = async_mpt_vendor.catalog.products.documents(product_id) ops_service = async_mpt_ops.catalog.products.documents(product_id) - document = await vendor_service.review(created_document_from_file_async.id) assert document.status == "Pending" - document = await ops_service.publish(created_document_from_file_async.id) assert document.status == "Published" - document = await ops_service.unpublish(created_document_from_file_async.id) - assert document.status == "Unpublished" + result = await ops_service.unpublish(created_document_from_file_async.id) + + assert result.status == "Unpublished" async def test_not_found_async(async_document_service): diff --git a/tests/e2e/catalog/product/documents/test_sync_document.py b/tests/e2e/catalog/product/documents/test_sync_document.py index 70971762..b3285b24 100644 --- a/tests/e2e/catalog/product/documents/test_sync_document.py +++ b/tests/e2e/catalog/product/documents/test_sync_document.py @@ -76,19 +76,17 @@ def test_filter_documents(vendor_document_service, created_document_from_file): assert result[0].id == created_document_from_file.id -@pytest.mark.skip(reason="Leaves test documents in published state") # noqa: AAA01 def test_review_and_publish_document(mpt_vendor, mpt_ops, created_document_from_file, product_id): vendor_service = mpt_vendor.catalog.products.documents(product_id) ops_service = mpt_ops.catalog.products.documents(product_id) - document = vendor_service.review(created_document_from_file.id) assert document.status == "Pending" - document = ops_service.publish(created_document_from_file.id) assert document.status == "Published" - document = ops_service.unpublish(created_document_from_file.id) - assert document.status == "Unpublished" + result = ops_service.unpublish(created_document_from_file.id) + + assert result.status == "Unpublished" def test_not_found(vendor_document_service): diff --git a/tests/e2e/catalog/product/test_async_product.py b/tests/e2e/catalog/product/test_async_product.py index a63c1547..a8a4c243 100644 --- a/tests/e2e/catalog/product/test_async_product.py +++ b/tests/e2e/catalog/product/test_async_product.py @@ -3,6 +3,8 @@ from mpt_api_client import RQLQuery from mpt_api_client.exceptions import MPTAPIError +pytestmark = [pytest.mark.flaky] + @pytest.fixture async def async_created_product(async_mpt_vendor, product_data, logo_fd): @@ -16,14 +18,12 @@ async def async_created_product(async_mpt_vendor, product_data, logo_fd): print(f"TEARDOWN - Unable to delete product {product.id}: {error.title}") # noqa: WPS421 -@pytest.mark.flaky def test_create_product(async_created_product, product_data): result = async_created_product.name == product_data["name"] assert result is True -@pytest.mark.flaky async def test_update_product(async_mpt_vendor, async_created_product, logo_fd): update_data = {"name": "Updated Product"} @@ -36,26 +36,22 @@ async def test_update_product(async_mpt_vendor, async_created_product, logo_fd): assert result.name == update_data["name"] -@pytest.mark.skip(reason="Leaves test products in the catalog") -@pytest.mark.flaky async def test_product_review_and_publish(async_mpt_vendor, async_mpt_ops, async_created_product): await async_mpt_vendor.catalog.products.review(async_created_product.id) - await async_mpt_ops.catalog.products.publish(async_created_product.id) + + await async_mpt_ops.catalog.products.publish(async_created_product.id) # act -@pytest.mark.flaky async def test_get_product(async_mpt_vendor, product_id): await async_mpt_vendor.catalog.products.get(product_id) # act -@pytest.mark.flaky async def test_product_save_settings(async_mpt_vendor, async_created_product): await async_mpt_vendor.catalog.products.update_settings( # act async_created_product.id, {"itemSelection": True} ) -@pytest.mark.flaky async def test_filter_and_select_products(async_mpt_vendor, product_id): select_fields = ["-icon", "-revision", "-settings", "-vendor", "-statistics", "-website"] filtered_products = ( diff --git a/tests/e2e/catalog/product/test_sync_product.py b/tests/e2e/catalog/product/test_sync_product.py index 7a676ffd..75b493df 100644 --- a/tests/e2e/catalog/product/test_sync_product.py +++ b/tests/e2e/catalog/product/test_sync_product.py @@ -3,6 +3,8 @@ from mpt_api_client import RQLQuery from mpt_api_client.exceptions import MPTAPIError +pytestmark = [pytest.mark.flaky] + @pytest.fixture def created_product(mpt_vendor, product_data, logo_fd): @@ -16,14 +18,12 @@ def created_product(mpt_vendor, product_data, logo_fd): print(f"TEARDOWN - Unable to delete product {product.id}: {error.title}") # noqa: WPS421 -@pytest.mark.flaky def test_create_product(created_product, product_data): result = created_product.name == product_data["name"] assert result is True -@pytest.mark.flaky def test_update_product(mpt_vendor, created_product, logo_fd): update_data = {"name": "Updated Product"} @@ -32,24 +32,20 @@ def test_update_product(mpt_vendor, created_product, logo_fd): assert result.name == update_data["name"] -@pytest.mark.skip(reason="Leaves test products in the catalog") # noqa: AAA01 -@pytest.mark.flaky def test_product_review_and_publish(mpt_vendor, mpt_ops, created_product): mpt_vendor.catalog.products.review(created_product.id) - mpt_ops.catalog.products.publish(created_product.id) + + mpt_ops.catalog.products.publish(created_product.id) # act -@pytest.mark.flaky def test_get_product(mpt_vendor, product_id): mpt_vendor.catalog.products.get(product_id) # act -@pytest.mark.flaky def test_product_save_settings(mpt_vendor, created_product): mpt_vendor.catalog.products.update_settings(created_product.id, {"itemSelection": True}) # act -@pytest.mark.flaky def test_filter_and_select_products(mpt_vendor, product_id): select_fields = ["-icon", "-revision", "-settings", "-vendor", "-statistics", "-website"] filtered_products = ( diff --git a/tests/e2e/catalog/units_of_measure/test_async_units_of_measure.py b/tests/e2e/catalog/units_of_measure/test_async_units_of_measure.py index a43e5d68..ade2f4a5 100644 --- a/tests/e2e/catalog/units_of_measure/test_async_units_of_measure.py +++ b/tests/e2e/catalog/units_of_measure/test_async_units_of_measure.py @@ -11,7 +11,6 @@ def async_units_of_measure_service(async_mpt_ops): return async_mpt_ops.catalog.units_of_measure -@pytest.mark.skip(reason="Not implemented yet") async def test_create(async_units_of_measure_service, short_uuid): await async_units_of_measure_service.create({ "name": f"e2e-delete {short_uuid}", diff --git a/tests/e2e/catalog/units_of_measure/test_sync_units_of_measure.py b/tests/e2e/catalog/units_of_measure/test_sync_units_of_measure.py index f9ad2d5a..463a11a0 100644 --- a/tests/e2e/catalog/units_of_measure/test_sync_units_of_measure.py +++ b/tests/e2e/catalog/units_of_measure/test_sync_units_of_measure.py @@ -6,7 +6,6 @@ pytestmark = [pytest.mark.flaky] -@pytest.mark.skip(reason="Not implemented yet") def test_create(units_of_measure_service, short_uuid): units_of_measure_service.create({ "name": f"e2e-delete {short_uuid}",