Skip to content

Commit 6a902e7

Browse files
authored
Merge pull request #418 from testing-cabal/ruff-0.9.1
Bump ruff to 0.9.1
2 parents a6d205d + 76495e0 commit 6a902e7

File tree

11 files changed

+30
-59
lines changed

11 files changed

+30
-59
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ __version__ = {version_tuple!r}
7171
[project.optional-dependencies]
7272
test = ["testscenarios", "testresources"]
7373
twisted = ["Twisted", "fixtures"]
74-
dev = ["ruff==0.8.6"]
74+
dev = ["ruff==0.9.1"]

testtools/tests/matchers/test_dict.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,12 @@ class TestMatchesDict(TestCase, TestMatchersInterface):
127127

128128
describe_examples = [
129129
(
130-
"Missing: {\n"
131-
" 'baz': Not(Equals('qux')),\n"
132-
" 'foo': Equals('bar'),\n"
133-
"}",
130+
"Missing: {\n 'baz': Not(Equals('qux')),\n 'foo': Equals('bar'),\n}",
134131
{},
135132
matches_matcher,
136133
),
137134
(
138-
"Differences: {\n" " 'baz': 'qux' matches Equals('qux'),\n" "}",
135+
"Differences: {\n 'baz': 'qux' matches Equals('qux'),\n}",
139136
{"foo": "bar", "baz": "qux"},
140137
matches_matcher,
141138
),
@@ -148,17 +145,12 @@ class TestMatchesDict(TestCase, TestMatchersInterface):
148145
matches_matcher,
149146
),
150147
(
151-
"Extra: {\n" " 'cat': 'dog',\n" "}",
148+
"Extra: {\n 'cat': 'dog',\n}",
152149
{"foo": "bar", "baz": "quux", "cat": "dog"},
153150
matches_matcher,
154151
),
155152
(
156-
"Extra: {\n"
157-
" 'cat': 'dog',\n"
158-
"}\n"
159-
"Missing: {\n"
160-
" 'baz': Not(Equals('qux')),\n"
161-
"}",
153+
"Extra: {\n 'cat': 'dog',\n}\nMissing: {\n 'baz': Not(Equals('qux')),\n}",
162154
{"foo": "bar", "cat": "dog"},
163155
matches_matcher,
164156
),
@@ -192,15 +184,12 @@ class TestContainsDict(TestCase, TestMatchersInterface):
192184

193185
describe_examples = [
194186
(
195-
"Missing: {\n"
196-
" 'baz': Not(Equals('qux')),\n"
197-
" 'foo': Equals('bar'),\n"
198-
"}",
187+
"Missing: {\n 'baz': Not(Equals('qux')),\n 'foo': Equals('bar'),\n}",
199188
{},
200189
matches_matcher,
201190
),
202191
(
203-
"Differences: {\n" " 'baz': 'qux' matches Equals('qux'),\n" "}",
192+
"Differences: {\n 'baz': 'qux' matches Equals('qux'),\n}",
204193
{"foo": "bar", "baz": "qux"},
205194
matches_matcher,
206195
),
@@ -213,7 +202,7 @@ class TestContainsDict(TestCase, TestMatchersInterface):
213202
matches_matcher,
214203
),
215204
(
216-
"Missing: {\n" " 'baz': Not(Equals('qux')),\n" "}",
205+
"Missing: {\n 'baz': Not(Equals('qux')),\n}",
217206
{"foo": "bar", "cat": "dog"},
218207
matches_matcher,
219208
),
@@ -247,7 +236,7 @@ class TestContainedByDict(TestCase, TestMatchersInterface):
247236

248237
describe_examples = [
249238
(
250-
"Differences: {\n" " 'baz': 'qux' matches Equals('qux'),\n" "}",
239+
"Differences: {\n 'baz': 'qux' matches Equals('qux'),\n}",
251240
{"foo": "bar", "baz": "qux"},
252241
matches_matcher,
253242
),
@@ -260,7 +249,7 @@ class TestContainedByDict(TestCase, TestMatchersInterface):
260249
matches_matcher,
261250
),
262251
(
263-
"Extra: {\n" " 'cat': 'dog',\n" "}",
252+
"Extra: {\n 'cat': 'dog',\n}",
264253
{"foo": "bar", "cat": "dog"},
265254
matches_matcher,
266255
),

testtools/tests/matchers/test_doctest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TestDocTestMatchesInterface(TestCase, TestMatchersInterface):
2626

2727
describe_examples = [
2828
(
29-
"Expected:\n Ran 1 tests in ...s\nGot:\n" " Ran 1 test in 0.123s\n",
29+
"Expected:\n Ran 1 tests in ...s\nGot:\n Ran 1 test in 0.123s\n",
3030
"Ran 1 test in 0.123s",
3131
DocTestMatches("Ran 1 tests in ...s", doctest.ELLIPSIS),
3232
)

testtools/tests/matchers/test_higherorder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class TestAllMatch(TestCase, TestMatchersInterface):
4343

4444
describe_examples = [
4545
(
46-
"Differences: [\n" "11 >= 10\n" "10 >= 10\n" "]",
46+
"Differences: [\n11 >= 10\n10 >= 10\n]",
4747
[11, 9, 10],
4848
AllMatch(LessThan(10)),
4949
),
@@ -72,7 +72,7 @@ class TestAnyMatch(TestCase, TestMatchersInterface):
7272

7373
describe_examples = [
7474
(
75-
"Differences: [\n" "11 != 7\n" "9 != 7\n" "10 != 7\n" "]",
75+
"Differences: [\n11 != 7\n9 != 7\n10 != 7\n]",
7676
[11, 9, 10],
7777
AnyMatch(Equals(7)),
7878
),

testtools/tests/matchers/test_impl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_verbose_description(self):
6767
matcher = Equals(3)
6868
mismatch = matcher.match(2)
6969
e = MismatchError(matchee, matcher, mismatch, True)
70-
expected = "Match failed. Matchee: %r\n" "Matcher: %s\n" "Difference: %s\n" % (
70+
expected = "Match failed. Matchee: %r\nMatcher: %s\nDifference: %s\n" % (
7171
matchee,
7272
matcher,
7373
matcher.match(matchee).describe(),
@@ -80,7 +80,7 @@ def test_verbose_unicode(self):
8080
matchee = "\xa7"
8181
matcher = Equals("a")
8282
mismatch = matcher.match(matchee)
83-
expected = "Match failed. Matchee: %s\n" "Matcher: %s\n" "Difference: %s\n" % (
83+
expected = "Match failed. Matchee: %s\nMatcher: %s\nDifference: %s\n" % (
8484
text_repr(matchee),
8585
matcher,
8686
mismatch.describe(),

testtools/tests/test_assert_that.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_assertThat_message_is_annotated(self):
8686
def test_assertThat_verbose_output(self):
8787
matchee = "foo"
8888
matcher = Equals("bar")
89-
expected = "Match failed. Matchee: %r\n" "Matcher: %s\n" "Difference: %s\n" % (
89+
expected = "Match failed. Matchee: %r\nMatcher: %s\nDifference: %s\n" % (
9090
matchee,
9191
matcher,
9292
matcher.match(matchee).describe(),
@@ -124,15 +124,10 @@ def test_assertThat_verbose_unicode(self):
124124
# unicode strings, we can still provide a meaningful error.
125125
matchee = "\xa7"
126126
matcher = Equals("a")
127-
expected = (
128-
"Match failed. Matchee: %s\n"
129-
"Matcher: %s\n"
130-
"Difference: %s\n\n"
131-
% (
132-
repr(matchee).replace("\\xa7", matchee),
133-
matcher,
134-
matcher.match(matchee).describe(),
135-
)
127+
expected = "Match failed. Matchee: %s\nMatcher: %s\nDifference: %s\n\n" % (
128+
repr(matchee).replace("\\xa7", matchee),
129+
matcher,
130+
matcher.match(matchee).describe(),
136131
)
137132
e = self.assertRaises(
138133
self.failureException,

testtools/tests/test_testcase.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ def test_assertThat_message_is_annotated(self):
692692
def test_assertThat_verbose_output(self):
693693
matchee = "foo"
694694
matcher = Equals("bar")
695-
expected = "Match failed. Matchee: %r\n" "Matcher: %s\n" "Difference: %s\n" % (
695+
expected = "Match failed. Matchee: %r\nMatcher: %s\nDifference: %s\n" % (
696696
matchee,
697697
matcher,
698698
matcher.match(matchee).describe(),
@@ -776,15 +776,10 @@ def test_assertThat_verbose_unicode(self):
776776
# unicode strings, we can still provide a meaningful error.
777777
matchee = "\xa7"
778778
matcher = Equals("a")
779-
expected = (
780-
"Match failed. Matchee: %s\n"
781-
"Matcher: %s\n"
782-
"Difference: %s\n\n"
783-
% (
784-
repr(matchee).replace("\\xa7", matchee),
785-
matcher,
786-
matcher.match(matchee).describe(),
787-
)
779+
expected = "Match failed. Matchee: %s\nMatcher: %s\nDifference: %s\n\n" % (
780+
repr(matchee).replace("\\xa7", matchee),
781+
matcher,
782+
matcher.match(matchee).describe(),
788783
)
789784
e = self.assertRaises(
790785
self.failureException, self.assertThat, matchee, matcher, verbose=True

testtools/tests/test_testresult.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,7 +3042,7 @@ def test_syntax_error_line_iso_8859_1(self):
30423042
self.assertIn(
30433043
self._as_output(
30443044
#'bad.py", line 2\n'
3045-
" ! = 0 # %s\n" " ^\n" "SyntaxError: " % (text,)
3045+
" ! = 0 # %s\n ^\nSyntaxError: " % (text,)
30463046
),
30473047
textoutput,
30483048
)
@@ -3176,15 +3176,7 @@ def test_multiple_text_content(self):
31763176
self.assertThat(
31773177
string,
31783178
Equals(
3179-
"attachment: {{{\n"
3180-
"foo\n"
3181-
"foo\n"
3182-
"}}}\n"
3183-
"\n"
3184-
"attachment-1: {{{\n"
3185-
"bar\n"
3186-
"bar\n"
3187-
"}}}\n"
3179+
"attachment: {{{\nfoo\nfoo\n}}}\n\nattachment-1: {{{\nbar\nbar\n}}}\n"
31883180
),
31893181
)
31903182

testtools/tests/twistedsupport/test_matchers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def test_not_fired_fails(self):
139139
self.match(arbitrary_matcher, deferred),
140140
mismatches(
141141
Equals(
142-
("Success result expected on %r, found no result " "instead")
142+
("Success result expected on %r, found no result instead")
143143
% (deferred,)
144144
)
145145
),

testtools/twistedsupport/_deferred.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ImpossibleDeferredError(Exception):
5050
"""Raised if a Deferred somehow triggers both a success and a failure."""
5151

5252
def __init__(self, deferred, successes, failures):
53-
msg = "Impossible condition on %r, got both success (%r) and " "failure (%r)"
53+
msg = "Impossible condition on %r, got both success (%r) and failure (%r)"
5454
super().__init__(msg % (deferred, successes, failures))
5555

5656

0 commit comments

Comments
 (0)