Skip to content

Commit 33fcf3f

Browse files
authored
Merge pull request #69 from jelmer/ruff-check
Run ruff check
2 parents d30f522 + 5c8f1cd commit 33fcf3f

28 files changed

+30
-56
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ jobs:
4343
run: |
4444
python -W once -m testtools.run testrepository.tests.test_suite
4545
46+
- name: Lint
47+
run: |
48+
ruff check .
49+
4650
- name: Check formatting
4751
run: |
4852
ruff format --check .

testrepository/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
The tests package contains tests and test specific support code.
2323
"""
2424

25+
__all__ = ["__version__"]
26+
27+
2528
try:
2629
# If setuptools_scm is installed (e.g. in a development environment with
2730
# an editable install), then use it to determine the version dynamically.

testrepository/arguments/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def summary(self):
7070
return result + "+"
7171
if minmax == (0, None):
7272
return result + "*"
73-
if minmax[1] == None:
73+
if minmax[1] is None:
7474
minmax = (minmax[0], "")
7575
return result + "{%s,%s}" % minmax
7676

testrepository/commands/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
import os
3838
import sys
3939

40-
import subunit
41-
4240
from testrepository.repository import file
4341

4442

testrepository/commands/failing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import optparse
1818

1919
import testtools
20-
from testtools import ExtendedToStreamDecorator, MultiTestResult
2120

2221
from testrepository.commands import Command
2322
from testrepository.testcommand import TestCommand

testrepository/commands/last.py

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

1717
import optparse
1818

19-
import testtools
2019

2120
from testrepository.commands import Command
2221
from testrepository.testcommand import TestCommand

testrepository/commands/list_tests.py

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

1717
from io import BytesIO
1818

19-
from testtools import TestResult
2019

2120
from testrepository.arguments.doubledash import DoubledashArgument
2221
from testrepository.arguments.string import StringArgument

testrepository/commands/load.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"""Load data into a repository."""
1616

1717
from functools import partial
18-
from operator import methodcaller
1918
import optparse
2019
import threading
2120

@@ -111,9 +110,9 @@ def run(self):
111110
streams = map(opener, self.ui.arguments["streams"])
112111
else:
113112
streams = self.ui.iter_streams("subunit")
114-
mktagger = lambda pos, result: testtools.StreamTagger(
115-
[result], add=["worker-%d" % pos]
116-
)
113+
114+
def mktagger(pos, result):
115+
return testtools.StreamTagger([result], add=["worker-%d" % pos])
117116

118117
def make_tests():
119118
for pos, stream in enumerate(streams):

testrepository/commands/run.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@
1717
from io import BytesIO
1818
from math import ceil
1919
import optparse
20-
import re
2120

2221
import subunit
2322
import testtools
24-
from testtools import (
25-
TestByTestResult,
26-
)
2723

2824
from testrepository.arguments.doubledash import DoubledashArgument
2925
from testrepository.arguments.string import StringArgument

testrepository/repository/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
the initialize function in the appropriate repository module.
2828
"""
2929

30-
from testtools import StreamToDict, TestResult
30+
from testtools import StreamToDict
3131

3232

3333
class AbstractRepositoryFactory(object):

0 commit comments

Comments
 (0)