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]

(cherry picked from commit d5d149e)
  • Loading branch information
lubosmj authored and patchback[bot] committed Aug 19, 2024
1 parent 31d85ce commit 6fbd44d
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 6fbd44d

Please sign in to comment.