Skip to content

Commit 4a97348

Browse files
committed
linting and formatting fixes
1 parent 6bae172 commit 4a97348

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/tests/v3/basic_flask_server.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
from typing import Generator, NoReturn
1717

1818
import requests
19-
from flask import Flask, Response, make_response
2019
from yarl import URL
2120

21+
from flask import Flask, Response, make_response
22+
2223
logger = logging.getLogger(__name__)
2324

2425

@@ -95,12 +96,12 @@ def redirect() -> NoReturn:
9596

9697
@app.route("/path/to/<test_id>")
9798
def hello_world(test_id: int) -> Response:
99+
random_regex_matches = "1-8 digits: 12345678, 1-8 random letters abcdefgh"
98100
response = make_response({
99101
"response": {
100102
"id": test_id,
101103
"regexMatches": "must end with 'hello world'",
102-
"randomRegexMatches":
103-
"1-8 digits: 12345678, 1-8 random letters abcdefgh",
104+
"randomRegexMatches": random_regex_matches,
104105
"integerMatches": test_id,
105106
"decimalMatches": round(uniform(0, 9), 3), # noqa: S311
106107
"booleanMatches": True,

examples/tests/v3/test_matchers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test_matchers() -> None:
9696
assert (
9797
response_data["response"]["regexMatches"] == "must end with 'hello world'"
9898
)
99-
assert response_data["response"]["integerMatches"] == 42 # noqa: PLR2004
99+
assert response_data["response"]["integerMatches"] == 42
100100
assert response_data["response"]["booleanMatches"] is False
101101
assert response_data["response"]["includeMatches"] == "world"
102102
assert response_data["response"]["dateMatches"] == "2024-01-01"
@@ -116,12 +116,12 @@ def test_matchers() -> None:
116116
)
117117
random_integer = int(response_data["response"]["randomIntegerMatches"])
118118
assert random_integer >= 1
119-
assert random_integer <= 100 # noqa: PLR2004
119+
assert random_integer <= 100
120120
float(response_data["response"]["randomDecimalMatches"])
121121
assert (
122-
len(response_data["response"]["randomDecimalMatches"].replace(".", "")) == 4 # noqa: PLR2004
122+
len(response_data["response"]["randomDecimalMatches"].replace(".", "")) == 4
123123
)
124-
assert len(response_data["response"]["randomStringMatches"]) == 10 # noqa: PLR2004
124+
assert len(response_data["response"]["randomStringMatches"]) == 10
125125

126126
pact.write_file(pact_dir, overwrite=True)
127127
with start_provider() as url:

src/pact/v3/matchers/matchers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"equality",
3131
"regex",
3232
"type",
33-
"type",
3433
"include",
3534
"integer",
3635
"decimal",

0 commit comments

Comments
 (0)