Skip to content

Commit bcd580f

Browse files
committed
Revert mocking change to GitHub tests. Changes focused on that can be done at another time
1 parent f1b7aa3 commit bcd580f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests/unit/oidc/test_views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@ def test_mint_token_no_pending_publisher_ok(
500500
publisher = GitHubPublisherFactory()
501501
monkeypatch.setattr(publisher.__class__, "projects", [project])
502502
publisher.publisher_url = pretend.call_recorder(lambda **kw: "https://fake/url")
503+
# NOTE: Can't set __str__ using pretend.stub()
504+
monkeypatch.setattr(publisher.__class__, "__str__", lambda s: "fakespecifier")
503505

504506
def _find_publisher(claims, pending=False):
505507
if pending:
@@ -544,7 +546,7 @@ def find_service(iface, **kw):
544546
assert macaroon_service.create_macaroon.calls == [
545547
pretend.call(
546548
"fakedomain",
547-
f"OpenID token: example.yml ({datetime.fromtimestamp(0).isoformat()})",
549+
f"OpenID token: fakespecifier ({datetime.fromtimestamp(0).isoformat()})",
548550
[
549551
caveats.OIDCPublisher(
550552
oidc_publisher_id=str(publisher.id),

warehouse/oidc/models/github.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ def reify(self, session):
269269
Returns a `GitHubPublisher` for this `PendingGitHubPublisher`,
270270
deleting the `PendingGitHubPublisher` in the process.
271271
"""
272+
272273
maybe_publisher = (
273274
session.query(GitHubPublisher)
274275
.filter(

0 commit comments

Comments
 (0)