Skip to content

Commit

Permalink
Do not assert on a specific error message
Browse files Browse the repository at this point in the history
Once an upstream library changes its behaviour, we may observe
different error messages depending on the context.

This change fixes the following error:
> assert "[Name or service not known]"
	in ctx.value.task.error["description"]
E AssertionError: assert '[Name or service not known]'
	in 'Cannot connect to host i-am-an-invalid-url.com:80 ssl:default [None]'

[noissue]
  • Loading branch information
lubosmj authored and ipanova committed Aug 19, 2024
1 parent a331458 commit d5d149e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pulp_container/tests/functional/api/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@ def test_sync_reclaim_resync(

@pytest.mark.parallel
def test_sync_invalid_url(synced_container_repository_factory):
with pytest.raises(PulpTaskError) as ctx:
with pytest.raises(PulpTaskError):
synced_container_repository_factory(url="http://i-am-an-invalid-url.com/invalid/")

assert "[Name or service not known]" in ctx.value.task.error["description"]


@pytest.mark.parallel
@pytest.mark.parametrize(
Expand Down

0 comments on commit d5d149e

Please sign in to comment.