Skip to content

Commit c4763ff

Browse files
committed
Apply ruff fixes; mostly removing unused imports
1 parent 87ab359 commit c4763ff

File tree

10 files changed

+6
-40
lines changed

10 files changed

+6
-40
lines changed

doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# All configuration values have a default; values that are commented out
1111
# serve to show the default.
1212

13-
import sys, os
1413

1514
# If extensions (or modules to document with autodoc) are in another directory,
1615
# add these directories to sys.path here. If the directory is relative to the

testtools/deferredruntest.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

testtools/matchers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128

129129
# XXX: These are not explicitly included in __all__. It's unclear how much of
130130
# the public interface they really are.
131-
from ._impl import (
131+
from ._impl import ( # noqa: F401
132132
Matcher,
133133
Mismatch,
134134
MismatchError,

testtools/matchers/_warnings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from ._higherorder import (
1414
AfterPreprocessing,
1515
Annotate,
16-
MatchesAll,
17-
Not,
1816
)
1917
from ._impl import Mismatch
2018

testtools/run.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
$ python -m testtools.run testtools.tests.test_suite
99
"""
1010

11-
import argparse
1211
from functools import partial
1312
import os.path
1413
import sys

testtools/tests/test_content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import tempfile
66
import unittest
77

8-
from testtools import TestCase, skipUnless
8+
from testtools import TestCase
99
from testtools.compat import (
1010
_b,
1111
)

testtools/tests/twistedsupport/test_deferred.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ def test_failure(self):
5151

5252

5353
def test_suite():
54-
from unittest import TestLoader, TestSuite
54+
from unittest import TestLoader
5555
return TestLoader().loadTestsFromName(__name__)

testtools/tests/twistedsupport/test_matchers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,5 @@ def test_no_result_fails(self):
199199

200200

201201
def test_suite():
202-
from unittest import TestLoader, TestSuite
202+
from unittest import TestLoader
203203
return TestLoader().loadTestsFromName(__name__)

testtools/tests/twistedsupport/test_runtest.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
Is,
2222
KeysEqual,
2323
MatchesDict,
24-
MatchesException,
2524
MatchesListwise,
2625
Not,
27-
Raises,
2826
)
2927
from testtools.runtest import RunTest
3028
from testtools.testresult.doubles import ExtendedTestResult
@@ -875,7 +873,7 @@ def check_result(failure):
875873
class TestRunWithLogObservers(NeedsTwistedTestCase):
876874

877875
def test_restores_observers(self):
878-
from testtools.deferredruntest import run_with_log_observers
876+
from testtools.twistedsupport._runtest import run_with_log_observers
879877
from twisted.python import log
880878
# Make sure there's at least one observer. This reproduces bug
881879
# #926189.
@@ -1015,7 +1013,7 @@ def test_something(self):
10151013

10161014

10171015
def test_suite():
1018-
from unittest import TestLoader, TestSuite
1016+
from unittest import TestLoader
10191017
return TestLoader().loadTestsFromName(__name__)
10201018

10211019

testtools/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
warnings.warn("Please import iterate_tests from testtools.testsuite - "
1010
"testtools.utils is deprecated.", DeprecationWarning, stacklevel=2)
1111

12-
from testtools.testsuite import iterate_tests
1312

0 commit comments

Comments
 (0)