Skip to content

Commit 2c5ac0a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 400a669 commit 2c5ac0a

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/psf/black-pre-commit-mirror
5-
rev: ea488cebbfd88a5f50b8bd95d5c829d0bb76feb8 # frozen: 26.1.0
5+
rev: ea488cebbfd88a5f50b8bd95d5c829d0bb76feb8 # frozen: 26.1.0
66
hooks:
77
- id: black
88
- repo: https://github.com/pycqa/isort
@@ -26,7 +26,7 @@ repos:
2626
- id: pyupgrade
2727
args: [--py39-plus]
2828
- repo: https://github.com/python-poetry/poetry
29-
rev: "a84cd0f1bedb5769ef6ef7389d8ee99b93b9ba4c" # frozen: 2.3.2
29+
rev: "a84cd0f1bedb5769ef6ef7389d8ee99b93b9ba4c" # frozen: 2.3.2
3030
hooks:
3131
- id: poetry-check
3232
args: ["--lock"]

tests/test_model_name.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ def test_named_model():
7070

7171

7272
def test_generic_model_with_custom_name_no_warning(testdir):
73-
testdir.makepyfile(
74-
"""
73+
testdir.makepyfile("""
7574
from factory import Factory
7675
from pytest_factoryboy import named_model, register
7776
@@ -85,15 +84,13 @@ class Meta:
8584
def test_payload(json_payload: dict):
8685
assert isinstance(json_payload, dict)
8786
assert json_payload["foo"] == "bar"
88-
"""
89-
)
87+
""")
9088
result = testdir.runpytest("-Werror") # Warnings become errors
9189
assert_outcomes(result, passed=1)
9290

9391

9492
def test_generic_model_name_raises_warning(testdir):
95-
testdir.makepyfile(
96-
"""
93+
testdir.makepyfile("""
9794
import builtins
9895
from factory import Factory
9996
from pytest_factoryboy import register
@@ -108,8 +105,7 @@ class Meta:
108105
def test_payload(dict):
109106
assert isinstance(dict, builtins.dict)
110107
assert dict["foo"] == "bar"
111-
"""
112-
)
108+
""")
113109
result = testdir.runpytest()
114110
assert_outcomes(result, passed=1)
115111
result.stdout.fnmatch_lines(
@@ -118,8 +114,7 @@ def test_payload(dict):
118114

119115

120116
def test_generic_model_with_register_override_no_warning(testdir):
121-
testdir.makepyfile(
122-
"""
117+
testdir.makepyfile("""
123118
from factory import Factory
124119
from pytest_factoryboy import named_model, register
125120
@@ -134,15 +129,13 @@ def test_payload(json_payload: dict):
134129
assert isinstance(json_payload, dict)
135130
assert json_payload["foo"] == "bar"
136131
137-
"""
138-
)
132+
""")
139133
result = testdir.runpytest("-Werror") # Warnings become errors
140134
assert_outcomes(result, passed=1)
141135

142136

143137
def test_using_generic_model_name_for_subfactory_raises_warning(testdir):
144-
testdir.makepyfile(
145-
"""
138+
testdir.makepyfile("""
146139
import builtins
147140
from factory import Factory, SubFactory
148141
from pytest_factoryboy import register
@@ -166,8 +159,7 @@ class Meta:
166159
167160
def test_payload(http_request):
168161
assert http_request.json["foo"] == "bar"
169-
"""
170-
)
162+
""")
171163

172164
result = testdir.runpytest()
173165
assert_outcomes(result, errors=1)

0 commit comments

Comments
 (0)