Skip to content

Commit 7cc56bc

Browse files
committed
docs: fix tooltips in code
Signed-off-by: JP-Ellis <josh@jpellis.me>
1 parent b958162 commit 7cc56bc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/blog/posts/2025/12-04 pact-python-v3-release.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ provider = Provider('my-backend-service')
6565
pact = consumer.has_pact_with(provider, pact_dir='/path/to/pacts')
6666
(
6767
pact
68-
.given('user exists') # 1
68+
.given('user exists') # (1)
6969
.upon_receiving('a request for user data')
7070
.with_request(
7171
'GET',
@@ -80,12 +80,12 @@ pact = consumer.has_pact_with(provider, pact_dir='/path/to/pacts')
8080
)
8181
)
8282

83-
pact.start_service() # 2
83+
pact.start_service() # (2)
8484
pact.setup()
8585
response = requests.get(pact.uri + '/users/123')
8686
assert response.json() == {'id': 123, 'name': 'Alice'}
87-
pact.verify() # 3
88-
pact.stop_service() # 4
87+
pact.verify() # (3)
88+
pact.stop_service() # (4)
8989
# Pact file is written as part of verify() or when the service stops
9090
```
9191

@@ -102,7 +102,7 @@ pact = Pact('my-web-front-end', 'my-backend-service')
102102
(
103103
pact
104104
.upon_receiving('a request for user data')
105-
.given('user exists', id=123, name='Alice') # 1
105+
.given('user exists', id=123, name='Alice') # (1)
106106
.with_request('GET', '/users/123')
107107
.with_header('Accept', 'application/json')
108108
.with_query_parameter('include', 'profile')
@@ -111,10 +111,10 @@ pact = Pact('my-web-front-end', 'my-backend-service')
111111
.with_body({'id': 123, 'name': 'Alice'}, content_type='application/json')
112112
)
113113

114-
with pact.serve() as srv: # 2
114+
with pact.serve() as srv: # (2)
115115
response = requests.get(f"{srv.url}/users/123")
116116
assert response.json() == {'id': 123, 'name': 'Alice'}
117-
pact.write_file('/path/to/pacts') # 3
117+
pact.write_file('/path/to/pacts') # (3)
118118
```
119119

120120
1. In v3, provider states can be parameterized, making it easier to reuse and manage test data across different scenarios.

0 commit comments

Comments
 (0)