Skip to content

Commit 202337b

Browse files
Fix a few minor typos (#1064)
1 parent 11031ea commit 202337b

5 files changed

Lines changed: 19 additions & 13 deletions

File tree

tavern/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
"""Stop pytest warning about module already imported: PYTEST_DONT_REWRITE"""
1+
"""Tavern pytest plugin.
2+
3+
Stop pytest warning about module already imported: PYTEST_DONT_REWRITE
4+
"""
25

36
__version__ = "3.6.1"

tavern/_core/pytest/error.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# noinspection PyProtectedMember
12
import copy
23
import dataclasses
34
import json
@@ -128,7 +129,7 @@ def _print_test_stage(
128129
129130
If we couldn't get the stage for some reason, print the entire test out.
130131
131-
If there are any lines which have missing format variables, higlight
132+
If there are any lines which have missing format variables, highlight
132133
them in red.
133134
134135
Args:

tavern/_plugins/rest/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def partition(pred, iterable):
356356
t1, t2 = tee(iterable)
357357
return list(filterfalse(pred, t1)), list(filter(pred, t2))
358358

359-
# Cookies are either a single list item, specitying which cookie to send, or
359+
# Cookies are either a single list item, specifying which cookie to send, or
360360
# a mapping, specifying cookies to override
361361
expected, extra = partition(lambda x: isinstance(x, dict), cookies_to_use)
362362

tavern/helpers.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def validate_pykwalify(response: requests.Response, schema: dict) -> None:
104104
"""Make sure the response matches a given schema
105105
106106
Args:
107-
response: reqeusts Response object
107+
response: requests Response object
108108
schema: Schema for response
109109
"""
110110
try:
@@ -177,7 +177,7 @@ def validate_content(response: requests.Response, comparisons: Iterable[dict]) -
177177
"""Asserts expected value with actual value using JMES path expression
178178
179179
Args:
180-
response: reqeusts.Response object.
180+
response: requests.Response object.
181181
comparisons:
182182
A list of dict containing the following keys:
183183
1. jmespath : JMES path expression to extract data from.
@@ -190,11 +190,13 @@ def validate_content(response: requests.Response, comparisons: Iterable[dict]) -
190190

191191
actual = jmespath.search(path, response.json())
192192

193-
expession = " ".join([str(path), str(_operator), str(expected)])
194-
parsed_expession = " ".join([str(actual), str(_operator), str(expected)])
193+
expression = " ".join([str(path), str(_operator), str(expected)])
194+
parsed_expression = " ".join([str(actual), str(_operator), str(expected)])
195195

196196
try:
197-
actual_validation(_operator, actual, expected, parsed_expession, expession)
197+
actual_validation(
198+
_operator, actual, expected, parsed_expression, expression
199+
)
198200
except AssertionError as e:
199201
raise exceptions.JMESError("Error validating JMES") from e
200202

tests/unit/test_request.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def fix_example_request():
4545

4646
class TestRequests:
4747
def test_unknown_fields(self, req, includes):
48-
"""Unkown args should raise an error"""
48+
"""Unknown args should raise an error"""
4949
req["fodokfowe"] = "Hello"
5050

5151
with pytest.raises(exceptions.UnexpectedKeysError):
@@ -70,7 +70,7 @@ def test_bad_get_body(self, req, includes):
7070

7171
class TestHttpRedirects:
7272
def test_session_called_no_redirects(self, req, includes):
73-
"""Always disable redirects by defauly"""
73+
"""Always disable redirects by default"""
7474

7575
assert _check_allow_redirects(req, includes) is False
7676

@@ -115,7 +115,7 @@ def test_available_not_waited(self, req, includes):
115115
assert _read_expected_cookies(mock_session, req, includes) is None
116116

117117
def test_ask_for_nothing(self, req, includes):
118-
"""explicitly ask fo rno cookies"""
118+
"""explicitly ask for no cookies"""
119119

120120
cookiejar = RequestsCookieJar()
121121
cookiejar.set("a", "2")
@@ -159,7 +159,7 @@ def test_format_cookies(self, req, includes):
159159
assert _read_expected_cookies(mock_session, req, includes) == {"a": "2"}
160160

161161
def test_no_overwrite_cookie(self, req, includes):
162-
"""cant redefine a cookie from previous request"""
162+
"""cannot redefine a cookie from previous request"""
163163

164164
cookiejar = RequestsCookieJar()
165165
cookiejar.set("a", "2")
@@ -172,7 +172,7 @@ def test_no_overwrite_cookie(self, req, includes):
172172
_read_expected_cookies(mock_session, req, includes)
173173

174174
def test_no_duplicate_cookie(self, req, includes):
175-
"""Can't override a cookiev alue twice"""
175+
"""Can't override a cookie value twice"""
176176

177177
cookiejar = RequestsCookieJar()
178178

0 commit comments

Comments
 (0)