Skip to content

Commit 797505b

Browse files
authored
Merge pull request #374 from testing-cabal/dependabot
Install ruff from pyproject.toml, configure dependabot
2 parents a481b55 + 74c3b6e commit 797505b

File tree

7 files changed

+46
-41
lines changed

7 files changed

+46
-41
lines changed

.github/dependabot.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Please see the documentation for all configuration options:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
interval: weekly
10+
- package-ecosystem: "pip"
11+
directory: "/"
12+
schedule:
13+
interval: weekly

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
3333
- name: Install dependencies
3434
run: |
35-
python3 -m pip install --upgrade pip
36-
python3 -m pip install --upgrade setuptools wheel setuptools_scm ruff
37-
python3 -m pip install sphinx
38-
python3 -m pip install ".[test,twisted]"
35+
python -m pip install --upgrade pip
36+
python -m pip install --upgrade setuptools wheel setuptools_scm
37+
python -m pip install sphinx
38+
python -m pip install ".[test,twisted,dev]"
3939
4040
- name: Ruff
4141
run: |

pyproject.toml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ include-package-data = false
5454
include = ["testtools"]
5555
exclude = ["man*"]
5656

57-
[tool.extras]
58-
test = """
59-
testscenarios
60-
testresources"""
61-
twisted = """
62-
Twisted"""
63-
6457
[tool.files]
6558
packages = "testtools"
6659

@@ -79,3 +72,4 @@ __version__ = {version_tuple!r}
7972
[project.optional-dependencies]
8073
test = ["testscenarios", "testresources"]
8174
twisted = ["Twisted", "fixtures"]
75+
dev = ["ruff==0.4.4"]

testtools/tests/matchers/test_basic.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -230,17 +230,17 @@ def test_describe(self):
230230
self.assertEqual("'fo' does not start with 'bo'.", mismatch.describe())
231231

232232
def test_describe_non_ascii_unicode(self):
233-
string = "A\xA7"
234-
suffix = "B\xA7"
233+
string = "A\xa7"
234+
suffix = "B\xa7"
235235
mismatch = DoesNotStartWith(string, suffix)
236236
self.assertEqual(
237237
"{} does not start with {}.".format(text_repr(string), text_repr(suffix)),
238238
mismatch.describe(),
239239
)
240240

241241
def test_describe_non_ascii_bytes(self):
242-
string = _b("A\xA7")
243-
suffix = _b("B\xA7")
242+
string = _b("A\xa7")
243+
suffix = _b("B\xa7")
244244
mismatch = DoesNotStartWith(string, suffix)
245245
self.assertEqual(
246246
f"{string!r} does not start with {suffix!r}.", mismatch.describe()
@@ -255,12 +255,12 @@ def test_str(self):
255255
self.assertEqual("StartsWith('bar')", str(matcher))
256256

257257
def test_str_with_bytes(self):
258-
b = _b("\xA7")
258+
b = _b("\xa7")
259259
matcher = StartsWith(b)
260260
self.assertEqual(f"StartsWith({b!r})", str(matcher))
261261

262262
def test_str_with_unicode(self):
263-
u = "\xA7"
263+
u = "\xa7"
264264
matcher = StartsWith(u)
265265
self.assertEqual(f"StartsWith({u!r})", str(matcher))
266266

@@ -291,17 +291,17 @@ def test_describe(self):
291291
self.assertEqual("'fo' does not end with 'bo'.", mismatch.describe())
292292

293293
def test_describe_non_ascii_unicode(self):
294-
string = "A\xA7"
295-
suffix = "B\xA7"
294+
string = "A\xa7"
295+
suffix = "B\xa7"
296296
mismatch = DoesNotEndWith(string, suffix)
297297
self.assertEqual(
298298
"{} does not end with {}.".format(text_repr(string), text_repr(suffix)),
299299
mismatch.describe(),
300300
)
301301

302302
def test_describe_non_ascii_bytes(self):
303-
string = _b("A\xA7")
304-
suffix = _b("B\xA7")
303+
string = _b("A\xa7")
304+
suffix = _b("B\xa7")
305305
mismatch = DoesNotEndWith(string, suffix)
306306
self.assertEqual(
307307
f"{string!r} does not end with {suffix!r}.", mismatch.describe()
@@ -316,12 +316,12 @@ def test_str(self):
316316
self.assertEqual("EndsWith('bar')", str(matcher))
317317

318318
def test_str_with_bytes(self):
319-
b = _b("\xA7")
319+
b = _b("\xa7")
320320
matcher = EndsWith(b)
321321
self.assertEqual(f"EndsWith({b!r})", str(matcher))
322322

323323
def test_str_with_unicode(self):
324-
u = "\xA7"
324+
u = "\xa7"
325325
matcher = EndsWith(u)
326326
self.assertEqual(f"EndsWith({u!r})", str(matcher))
327327

@@ -404,8 +404,8 @@ class TestMatchesRegex(TestCase, TestMatchersInterface):
404404
("MatchesRegex('a|b')", MatchesRegex("a|b")),
405405
("MatchesRegex('a|b', re.M)", MatchesRegex("a|b", re.M)),
406406
("MatchesRegex('a|b', re.I|re.M)", MatchesRegex("a|b", re.I | re.M)),
407-
("MatchesRegex({!r})".format(_b("\xA7")), MatchesRegex(_b("\xA7"))),
408-
("MatchesRegex({!r})".format("\xA7"), MatchesRegex("\xA7")),
407+
("MatchesRegex({!r})".format(_b("\xa7")), MatchesRegex(_b("\xa7"))),
408+
("MatchesRegex({!r})".format("\xa7"), MatchesRegex("\xa7")),
409409
]
410410

411411
describe_examples = [
@@ -414,9 +414,9 @@ class TestMatchesRegex(TestCase, TestMatchersInterface):
414414
(
415415
"{!r} does not match /\\s+\\xa7/".format(_b("c")),
416416
_b("c"),
417-
MatchesRegex(_b("\\s+\xA7")),
417+
MatchesRegex(_b("\\s+\xa7")),
418418
),
419-
("{!r} does not match /\\s+\\xa7/".format("c"), "c", MatchesRegex("\\s+\xA7")),
419+
("{!r} does not match /\\s+\\xa7/".format("c"), "c", MatchesRegex("\\s+\xa7")),
420420
]
421421

422422

testtools/tests/test_compat.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class TestTextRepr(testtools.TestCase):
111111
("'", '"\'"', "'''\\\n\\''''"),
112112
("\\", "'\\\\'", "'''\\\n\\\\'''"),
113113
# DEL is also unprintable and should be escaped
114-
("\x7F", "'\\x7f'", "'''\\\n\\x7f'''"),
114+
("\x7f", "'\\x7f'", "'''\\\n\\x7f'''"),
115115
# Character combinations that need double checking
116116
("\r\n", "'\\r\\n'", "'''\\\n\\r\n'''"),
117117
("\"'", "'\"\\''", "'''\\\n\"\\''''"),
@@ -127,29 +127,29 @@ class TestTextRepr(testtools.TestCase):
127127
# Bytes with the high bit set should always be escaped
128128
bytes_examples = (
129129
(_b("\x80"), "'\\x80'", "'''\\\n\\x80'''"),
130-
(_b("\xA0"), "'\\xa0'", "'''\\\n\\xa0'''"),
131-
(_b("\xC0"), "'\\xc0'", "'''\\\n\\xc0'''"),
132-
(_b("\xFF"), "'\\xff'", "'''\\\n\\xff'''"),
133-
(_b("\xC2\xA7"), "'\\xc2\\xa7'", "'''\\\n\\xc2\\xa7'''"),
130+
(_b("\xa0"), "'\\xa0'", "'''\\\n\\xa0'''"),
131+
(_b("\xc0"), "'\\xc0'", "'''\\\n\\xc0'''"),
132+
(_b("\xff"), "'\\xff'", "'''\\\n\\xff'''"),
133+
(_b("\xc2\xa7"), "'\\xc2\\xa7'", "'''\\\n\\xc2\\xa7'''"),
134134
)
135135

136136
# Unicode doesn't escape printable characters as per the Python 3 model
137137
unicode_examples = (
138138
# C1 codes are unprintable
139139
("\x80", "'\\x80'", "'''\\\n\\x80'''"),
140-
("\x9F", "'\\x9f'", "'''\\\n\\x9f'''"),
140+
("\x9f", "'\\x9f'", "'''\\\n\\x9f'''"),
141141
# No-break space is unprintable
142-
("\xA0", "'\\xa0'", "'''\\\n\\xa0'''"),
142+
("\xa0", "'\\xa0'", "'''\\\n\\xa0'''"),
143143
# Letters latin alphabets are printable
144-
("\xA1", "'\xa1'", "'''\\\n\xa1'''"),
145-
("\xFF", "'\xff'", "'''\\\n\xff'''"),
144+
("\xa1", "'\xa1'", "'''\\\n\xa1'''"),
145+
("\xff", "'\xff'", "'''\\\n\xff'''"),
146146
("\u0100", "'\u0100'", "'''\\\n\u0100'''"),
147147
# Line and paragraph seperators are unprintable
148148
("\u2028", "'\\u2028'", "'''\\\n\\u2028'''"),
149149
("\u2029", "'\\u2029'", "'''\\\n\\u2029'''"),
150150
# Unpaired surrogates are unprintable
151-
("\uD800", "'\\ud800'", "'''\\\n\\ud800'''"),
152-
("\uDFFF", "'\\udfff'", "'''\\\n\\udfff'''"),
151+
("\ud800", "'\\ud800'", "'''\\\n\\ud800'''"),
152+
("\udfff", "'\\udfff'", "'''\\\n\\udfff'''"),
153153
# Unprintable general categories not fully tested: Cc, Cf, Co, Cn, Zs
154154
)
155155

testtools/tests/test_tags.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
"""Test tag support."""
44

5-
65
from testtools import TestCase
76
from testtools.tags import TagContext
87

testtools/tests/test_testresult.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
"""Test TestResults and related things."""
44

5-
65
import codecs
76
import datetime
87
import doctest
@@ -2928,7 +2927,7 @@ def test_control_characters_in_failure_string(self):
29282927
self._as_output("\a\a\a"),
29292928
textoutput,
29302929
)
2931-
self.assertIn(self._as_output("\uFFFD\uFFFD\uFFFD"), textoutput)
2930+
self.assertIn(self._as_output("\ufffd\ufffd\ufffd"), textoutput)
29322931

29332932
def _local_os_error_matcher(self):
29342933
return MatchesAny(Contains("FileExistsError: "), Contains("PermissionError: "))

0 commit comments

Comments
 (0)