Skip to content

Commit 8f1f14b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 49905ec commit 8f1f14b

3 files changed

Lines changed: 32 additions & 23 deletions

File tree

coincidence/fixtures.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def tmp_pathplus(tmp_path: Path) -> PathPlus:
6969
7070
pytest_plugins = ("coincidence", )
7171
72+
7273
def test_something(tmp_pathplus: PathPlus):
7374
assert True
7475
""" # noqa: D400
@@ -95,7 +96,9 @@ def fixed_datetime(monkeypatch) -> Iterator:
9596
9697
.. code-block:: python
9798
99+
# stdlib
98100
import datetime
101+
99102
print(datetime.datetime.now())
100103
101104
Using ``from datetime import datetime`` won't work.

coincidence/params.py

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,18 @@ def param(
154154
155155
.. code-block:: python
156156
157-
@pytest.mark.parametrize("test_input, expected", [
158-
("3+5", 8),
159-
param("6*9", 42, marks=pytest.mark.xfail),
160-
param("2**2", 4, idx=0),
161-
param("3**2", 9, id="3^2"),
162-
param("sqrt(9)", 3, key=itemgetter(0)),
163-
])
157+
@pytest.mark.parametrize(
158+
"test_input, expected",
159+
[
160+
("3+5", 8),
161+
param("6*9", 42, marks=pytest.mark.xfail),
162+
param("2**2", 4, idx=0),
163+
param("3**2", 9, id="3^2"),
164+
param("sqrt(9)", 3, key=itemgetter(0)),
165+
],
166+
)
164167
def test_eval(test_input, expected):
165-
assert eval (test_input) == expected
168+
assert eval(test_input) == expected
166169
167170
.. versionadded:: 0.4.0
168171
@@ -201,31 +204,32 @@ def parametrized_versions(
201204
.. code-block:: python
202205
203206
@pytest.mark.parametrize(
204-
"version",
205-
parametrized_versions(
206-
3.6,
207-
3.7,
208-
3.8,
209-
reason="Output differs on each version.",
210-
),
211-
)
207+
"version",
208+
parametrized_versions(
209+
3.6,
210+
3.7,
211+
3.8,
212+
reason="Output differs on each version.",
213+
),
214+
)
212215
def test_something(version: str):
213216
pass
214217
215218
216219
.. code-block:: python
217220
218221
@pytest.fixture(
219-
params=parametrized_versions(
220-
3.6,
221-
3.7,
222-
3.8,
223-
reason="Output differs on each version.",
224-
),
225-
)
222+
params=parametrized_versions(
223+
3.6,
224+
3.7,
225+
3.8,
226+
reason="Output differs on each version.",
227+
),
228+
)
226229
def version(request):
227230
return request.param
228231
232+
229233
def test_something(version: str):
230234
pass
231235

coincidence/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ def with_fixed_datetime(fixed_datetime: datetime.datetime) -> Iterator:
106106
107107
.. code-block:: python
108108
109+
# stdlib
109110
import datetime
111+
110112
print(datetime.datetime.now())
111113
112114
Using ``from datetime import datetime`` won't work.

0 commit comments

Comments
 (0)