Skip to content

Commit

Permalink
Apply ruff fixes; mostly removing unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Nov 1, 2023
1 parent 87ab359 commit c4763ff
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 40 deletions.
1 change: 0 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
27 changes: 0 additions & 27 deletions testtools/deferredruntest.py

This file was deleted.

2 changes: 1 addition & 1 deletion testtools/matchers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@

# XXX: These are not explicitly included in __all__. It's unclear how much of
# the public interface they really are.
from ._impl import (
from ._impl import ( # noqa: F401
Matcher,
Mismatch,
MismatchError,
Expand Down
2 changes: 0 additions & 2 deletions testtools/matchers/_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
from ._higherorder import (
AfterPreprocessing,
Annotate,
MatchesAll,
Not,
)
from ._impl import Mismatch

Expand Down
1 change: 0 additions & 1 deletion testtools/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
$ python -m testtools.run testtools.tests.test_suite
"""

import argparse
from functools import partial
import os.path
import sys
Expand Down
2 changes: 1 addition & 1 deletion testtools/tests/test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import tempfile
import unittest

from testtools import TestCase, skipUnless
from testtools import TestCase
from testtools.compat import (
_b,
)
Expand Down
2 changes: 1 addition & 1 deletion testtools/tests/twistedsupport/test_deferred.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ def test_failure(self):


def test_suite():
from unittest import TestLoader, TestSuite
from unittest import TestLoader
return TestLoader().loadTestsFromName(__name__)
2 changes: 1 addition & 1 deletion testtools/tests/twistedsupport/test_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,5 @@ def test_no_result_fails(self):


def test_suite():
from unittest import TestLoader, TestSuite
from unittest import TestLoader
return TestLoader().loadTestsFromName(__name__)
6 changes: 2 additions & 4 deletions testtools/tests/twistedsupport/test_runtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
Is,
KeysEqual,
MatchesDict,
MatchesException,
MatchesListwise,
Not,
Raises,
)
from testtools.runtest import RunTest
from testtools.testresult.doubles import ExtendedTestResult
Expand Down Expand Up @@ -875,7 +873,7 @@ def check_result(failure):
class TestRunWithLogObservers(NeedsTwistedTestCase):

def test_restores_observers(self):
from testtools.deferredruntest import run_with_log_observers
from testtools.twistedsupport._runtest import run_with_log_observers
from twisted.python import log
# Make sure there's at least one observer. This reproduces bug
# #926189.
Expand Down Expand Up @@ -1015,7 +1013,7 @@ def test_something(self):


def test_suite():
from unittest import TestLoader, TestSuite
from unittest import TestLoader
return TestLoader().loadTestsFromName(__name__)


Expand Down
1 change: 0 additions & 1 deletion testtools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
warnings.warn("Please import iterate_tests from testtools.testsuite - "
"testtools.utils is deprecated.", DeprecationWarning, stacklevel=2)

from testtools.testsuite import iterate_tests

0 comments on commit c4763ff

Please sign in to comment.