Skip to content

Commit

Permalink
Prefer mock.ANY over Any.string()
Browse files Browse the repository at this point in the history
  • Loading branch information
robertknight committed Feb 11, 2025
1 parent 8e20725 commit f177feb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/unit/h/views/admin/users_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from unittest import mock

import pytest
from h_matchers import Any
from pyramid import httpexceptions

from h.models import Annotation
Expand Down Expand Up @@ -36,7 +35,7 @@ def test_users_index(pyramid_request):
"username": None,
"authority": None,
"user": None,
"username_pattern": Any.string(),
"username_pattern": mock.ANY,
"user_meta": {},
"format_date": format_date,
}
Expand Down Expand Up @@ -91,7 +90,7 @@ def test_users_index_no_user_found(models, pyramid_request):
"authority": "foo.org",
"user": None,
"user_meta": {},
"username_pattern": Any.string(),
"username_pattern": mock.ANY,
"format_date": format_date,
}

Expand All @@ -110,7 +109,7 @@ def test_users_index_user_marked_as_deleted(models, pyramid_request, factories):
"authority": "foo.org",
"user": None,
"user_meta": {},
"username_pattern": Any.string(),
"username_pattern": mock.ANY,
"format_date": format_date,
}

Expand All @@ -132,7 +131,7 @@ def test_users_index_user_found(
"authority": "foo.org",
"user": user,
"user_meta": {"annotations_count": 8},
"username_pattern": Any.string(),
"username_pattern": mock.ANY,
"format_date": format_date,
}

Expand Down

0 comments on commit f177feb

Please sign in to comment.