From 5215378782d00c2370454719dda925eff3b39da8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 16:54:55 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4872875e..bf9299b5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: check-dependabot - id: check-readthedocs - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black language_version: python3 From f6d86d4d49358fe64496c8857065ac3e63f95ef9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 16:55:14 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- nose2/config.py | 1 - nose2/events.py | 36 ------------------------- nose2/exceptions.py | 2 -- nose2/loader.py | 1 - nose2/main.py | 1 - nose2/plugins/attrib.py | 1 - nose2/plugins/buffer.py | 1 - nose2/plugins/collect.py | 2 +- nose2/plugins/debugger.py | 2 +- nose2/plugins/doctests.py | 1 + nose2/plugins/dundertest.py | 1 + nose2/plugins/failfast.py | 1 - nose2/plugins/junitxml.py | 1 + nose2/plugins/loader/discovery.py | 1 - nose2/plugins/loader/eggdiscovery.py | 1 + nose2/plugins/loader/functions.py | 2 +- nose2/plugins/loader/generators.py | 2 +- nose2/plugins/loader/loadtests.py | 2 +- nose2/plugins/loader/parameters.py | 2 +- nose2/plugins/loader/testcases.py | 2 +- nose2/plugins/loader/testclasses.py | 3 --- nose2/plugins/logcapture.py | 2 +- nose2/plugins/mp.py | 2 -- nose2/plugins/outcomes.py | 1 - nose2/plugins/prettyassert.py | 1 - nose2/plugins/printhooks.py | 2 +- nose2/plugins/prof.py | 2 +- nose2/plugins/result.py | 2 +- nose2/plugins/testid.py | 2 +- nose2/result.py | 1 - nose2/runner.py | 1 - nose2/session.py | 1 - nose2/tests/_common.py | 10 +------ nose2/tests/functional/test_loading.py | 1 + nose2/tests/unit/test_doctest_plugin.py | 2 +- nose2/tests/unit/test_testid_plugin.py | 2 +- nose2/tools/params.py | 1 + nose2/tools/such.py | 3 --- nose2/util.py | 1 - 39 files changed, 21 insertions(+), 82 deletions(-) diff --git a/nose2/config.py b/nose2/config.py index d202d6ad..8df02257 100644 --- a/nose2/config.py +++ b/nose2/config.py @@ -3,7 +3,6 @@ class Config: - """Configuration for a plugin or other entities. Encapsulates configuration for a single plugin or other element. diff --git a/nose2/events.py b/nose2/events.py index e1dd809f..634c0d72 100644 --- a/nose2/events.py +++ b/nose2/events.py @@ -51,7 +51,6 @@ def __call__(cls, *args, **kwargs): class Plugin(metaclass=PluginMeta): - """Base class for nose2 plugins All nose2 plugins must subclass this class. @@ -207,7 +206,6 @@ def __call__(self, parser, namespace, values, option_string=None): class Hook: - """A plugin hook Each plugin method in the :class:`nose2.events.PluginInterface` is @@ -240,7 +238,6 @@ def append(self, plugin): class PluginInterface: - """Definition of plugin interface. Instances of this class contain the methods that may be called, @@ -347,7 +344,6 @@ def __getattr__(self, attr): class Event: - """Base class for all events. .. attribute :: metadata @@ -405,7 +401,6 @@ def __getstate__(self): class PluginsLoadedEvent(Event): - """Event fired after all plugin classes are loaded. .. attribute :: pluginsLoaded @@ -422,7 +417,6 @@ def __init__(self, pluginsLoaded, **kw): class RunnerCreatedEvent(Event): - """Event fired when test runner is created. .. attribute :: runner @@ -440,7 +434,6 @@ def __init__(self, runner, **kw): class ResultCreatedEvent(Event): - """Event fired when test result handler is created. .. attribute :: result @@ -458,7 +451,6 @@ def __init__(self, result, **kw): class StartLayerSetupEvent(Event): - """Event fired before running a layer setup. .. attribute :: layer @@ -474,7 +466,6 @@ def __init__(self, layer, **kw): class StopLayerSetupEvent(Event): - """Event fired after running a layer setup. .. attribute :: layer @@ -490,7 +481,6 @@ def __init__(self, layer, **kw): class StartLayerSetupTestEvent(Event): - """Event fired before test cases setups in layers. .. attribute :: layer @@ -511,7 +501,6 @@ def __init__(self, layer, test, **kw): class StopLayerSetupTestEvent(Event): - """Event fired after test cases setups in layers. .. attribute :: layer @@ -532,7 +521,6 @@ def __init__(self, layer, test, **kw): class StartLayerTeardownEvent(Event): - """Event fired before running a layer teardown. .. attribute :: layer @@ -548,7 +536,6 @@ def __init__(self, layer, **kw): class StopLayerTeardownEvent(Event): - """Event fired after running a layer teardown. .. attribute :: layer @@ -564,7 +551,6 @@ def __init__(self, layer, **kw): class StartLayerTeardownTestEvent(Event): - """Event fired before test cases teardowns in layers. .. attribute :: layer @@ -585,7 +571,6 @@ def __init__(self, layer, test, **kw): class StopLayerTeardownTestEvent(Event): - """Event fired after test cases teardowns in layers. .. attribute :: layer @@ -606,7 +591,6 @@ def __init__(self, layer, test, **kw): class StartTestRunEvent(Event): - """Event fired when test run is about to start. Test collection is complete before this event fires, but @@ -657,7 +641,6 @@ def __init__(self, runner, suite, result, startTime, executeTests, **kw): class StopTestRunEvent(Event): - """Event fired when test run has stopped. .. attribute :: runner @@ -689,7 +672,6 @@ def __init__(self, runner, result, stopTime, timeTaken, **kw): class StartTestEvent(Event): - """Event fired before a test is executed. .. attribute :: test @@ -716,7 +698,6 @@ def __init__(self, test, result, startTime, **kw): class StopTestEvent(Event): - """Event fired after a test is executed. .. attribute :: test @@ -743,7 +724,6 @@ def __init__(self, test, result, stopTime, **kw): class TestOutcomeEvent(Event): - """Event fired when a test completes. .. attribute :: test @@ -830,7 +810,6 @@ def __init__( class LoadFromModuleEvent(Event): - """Event fired when a test module is loaded. .. attribute :: loader @@ -874,7 +853,6 @@ def __init__(self, loader, module, suite, **kw): class LoadFromTestCaseEvent(Event): - """Event fired when tests are loaded from a test case. .. attribute :: loader @@ -908,7 +886,6 @@ def __init__(self, loader, testCase, **kw): class LoadFromNamesEvent(Event): - """Event fired to load tests from test names. .. attribute :: loader @@ -951,7 +928,6 @@ def __str__(self): class LoadFromNameEvent(Event): - """Event fired to load tests from test names. .. attribute :: loader @@ -991,7 +967,6 @@ def __init__(self, loader, name, module, **kw): class HandleFileEvent(Event): - """Event fired when a non-test file is examined. .. note :: @@ -1047,7 +1022,6 @@ def __init__(self, loader, name, path, pattern, topLevelDirectory, **kw): class MatchPathEvent(Event): - """Event fired during file matching. Plugins may return ``False`` and set ``handled`` on this event to prevent @@ -1078,7 +1052,6 @@ def __init__(self, name, path, pattern, **kw): class GetTestCaseNamesEvent(Event): - """Event fired to find test case names in a test case. Plugins may return a list of names and set ``handled`` on this @@ -1137,7 +1110,6 @@ def __init__(self, loader, testCase, isTestMethod, **kw): class ResultSuccessEvent(Event): - """Event fired at end of test run to determine success. This event fires at the end of the test run and allows @@ -1167,7 +1139,6 @@ def __init__(self, result, success, **kw): class ResultStopEvent(Event): - """Event fired when a test run is told to stop. Plugins can use this event to prevent other plugins from stopping @@ -1192,7 +1163,6 @@ def __init__(self, result, shouldStop, **kw): class DescribeTestEvent(Event): - """Event fired to get test description. @@ -1221,7 +1191,6 @@ def __init__(self, test, description=None, errorList=False, **kw): class OutcomeDetailEvent(Event): - """Event fired to acquire additional details about test outcome. .. attribute :: outcomeEvent @@ -1246,7 +1215,6 @@ def __init__(self, outcomeEvent, **kw): class ReportSummaryEvent(Event): - """Event fired before and after summary report. .. attribute :: stopTestEvent @@ -1277,7 +1245,6 @@ def __init__(self, stopTestEvent, stream, reportCategories, **kw): class ReportTestEvent(Event): - """Event fired to report a test event. Plugins can respond to this event by producing output for the user. @@ -1304,7 +1271,6 @@ def __init__(self, testEvent, stream, **kw): class UserInteractionEvent(Event): - """Event fired before and after user interaction. Plugins that capture stdout or otherwise prevent user interaction @@ -1321,7 +1287,6 @@ def __init__(self, **kw): class CommandLineArgsEvent(Event): - """Event fired after parsing of command line arguments. Plugins can respond to this event by configuring themselves or other plugins @@ -1347,7 +1312,6 @@ def __init__(self, args, **kw): class CreateTestsEvent(Event): - """Event fired before test loading. Plugins can take over test loading by returning a test suite and setting diff --git a/nose2/exceptions.py b/nose2/exceptions.py index c4ae2e29..ee0aaeb3 100644 --- a/nose2/exceptions.py +++ b/nose2/exceptions.py @@ -6,10 +6,8 @@ class TestNotFoundError(Exception): - """Raised when a named test cannot be found""" class LoadTestsFailure(Exception): - """Raised when a test cannot be loaded""" diff --git a/nose2/loader.py b/nose2/loader.py index 3d03df77..c41464fc 100644 --- a/nose2/loader.py +++ b/nose2/loader.py @@ -15,7 +15,6 @@ class PluggableTestLoader: - """Test loader that defers all loading to plugins :param session: Test run session. diff --git a/nose2/main.py b/nose2/main.py index 1e9d8497..a67929f0 100644 --- a/nose2/main.py +++ b/nose2/main.py @@ -10,7 +10,6 @@ class PluggableTestProgram(unittest.TestProgram): - """TestProgram that enables plugins. Accepts the same parameters as :class:`unittest.TestProgram`, diff --git a/nose2/plugins/attrib.py b/nose2/plugins/attrib.py index b176adc6..c117da92 100644 --- a/nose2/plugins/attrib.py +++ b/nose2/plugins/attrib.py @@ -8,7 +8,6 @@ class AttributeSelector(Plugin): - """Filter tests by attribute""" def __init__(self): diff --git a/nose2/plugins/buffer.py b/nose2/plugins/buffer.py index b5b8d317..a49585e9 100644 --- a/nose2/plugins/buffer.py +++ b/nose2/plugins/buffer.py @@ -51,7 +51,6 @@ def __repr__(self): class OutputBufferPlugin(events.Plugin): - """Buffer output during test execution""" commandLineSwitch = ("B", "output-buffer", "Enable output buffer") diff --git a/nose2/plugins/collect.py b/nose2/plugins/collect.py index 24583116..9a6d5e89 100644 --- a/nose2/plugins/collect.py +++ b/nose2/plugins/collect.py @@ -4,6 +4,7 @@ them. To do so it calls result.startTest, result.addSuccess and result.stopTest for each test, without calling the test itself. """ + import unittest from nose2.events import Plugin @@ -12,7 +13,6 @@ class CollectOnly(Plugin): - """Collect but don't run tests""" configSection = "collect-only" diff --git a/nose2/plugins/debugger.py b/nose2/plugins/debugger.py index 6a9c3309..c2a782e5 100644 --- a/nose2/plugins/debugger.py +++ b/nose2/plugins/debugger.py @@ -10,6 +10,7 @@ prevent this plugin from launching pdb. """ + import logging import pdb @@ -20,7 +21,6 @@ class Debugger(events.Plugin): - """Enter pdb on test error or failure .. attribute :: pdb diff --git a/nose2/plugins/doctests.py b/nose2/plugins/doctests.py index 75fabfb8..d644b07a 100644 --- a/nose2/plugins/doctests.py +++ b/nose2/plugins/doctests.py @@ -12,6 +12,7 @@ extensions = """ + import doctest import os diff --git a/nose2/plugins/dundertest.py b/nose2/plugins/dundertest.py index 9292e862..ff898c77 100644 --- a/nose2/plugins/dundertest.py +++ b/nose2/plugins/dundertest.py @@ -2,6 +2,7 @@ This plugin implements :func:`startTestRun`, which excludes all test objects that define a ``__test__`` attribute that evaluates to ``False``. """ + from unittest import TestSuite from nose2 import events diff --git a/nose2/plugins/failfast.py b/nose2/plugins/failfast.py index c9f296de..99daf19a 100644 --- a/nose2/plugins/failfast.py +++ b/nose2/plugins/failfast.py @@ -13,7 +13,6 @@ class FailFast(events.Plugin): - """Stop the test run after error or failure""" commandLineSwitch = ( diff --git a/nose2/plugins/junitxml.py b/nose2/plugins/junitxml.py index b56b8966..bd3bbc19 100644 --- a/nose2/plugins/junitxml.py +++ b/nose2/plugins/junitxml.py @@ -79,6 +79,7 @@ def test_params(arg): """ + # Based on unittest2/plugins/junitxml.py, # which is itself based on the junitxml plugin from py.test diff --git a/nose2/plugins/loader/discovery.py b/nose2/plugins/loader/discovery.py index 27b20ed5..1613d7fd 100644 --- a/nose2/plugins/loader/discovery.py +++ b/nose2/plugins/loader/discovery.py @@ -13,7 +13,6 @@ """ - # Adapted from unittest2/loader.py from the unittest2 plugins branch. # This module contains some code copied from unittest2/loader.py and other # code developed in reference to that module and others within unittest2. diff --git a/nose2/plugins/loader/eggdiscovery.py b/nose2/plugins/loader/eggdiscovery.py index 7b4278c9..ec783cfe 100644 --- a/nose2/plugins/loader/eggdiscovery.py +++ b/nose2/plugins/loader/eggdiscovery.py @@ -12,6 +12,7 @@ are examined for tests. """ + import logging import os diff --git a/nose2/plugins/loader/functions.py b/nose2/plugins/loader/functions.py index 00dff72c..32c56a31 100644 --- a/nose2/plugins/loader/functions.py +++ b/nose2/plugins/loader/functions.py @@ -47,6 +47,7 @@ def teardown(): to set ``paramList`` is with the :func:`nose2.tools.params` decorator. """ + # This module contains some code copied from unittest2/ and other code # developed in reference to unittest2. # unittest2 is Copyright (c) 2001-2010 Python Software Foundation; All @@ -65,7 +66,6 @@ def teardown(): class Functions(Plugin): - """Loader plugin that loads test functions""" alwaysOn = True diff --git a/nose2/plugins/loader/generators.py b/nose2/plugins/loader/generators.py index d4eb0a3f..a367ec48 100644 --- a/nose2/plugins/loader/generators.py +++ b/nose2/plugins/loader/generators.py @@ -19,6 +19,7 @@ def test_gen(): generated case you want to execute. """ + # This module contains some code copied from unittest2 and other code # developed in reference to unittest2. # unittest2 is Copyright (c) 2001-2010 Python Software Foundation; All @@ -39,7 +40,6 @@ def test_gen(): class Generators(Plugin): - """Loader plugin that loads generator tests""" alwaysOn = True diff --git a/nose2/plugins/loader/loadtests.py b/nose2/plugins/loader/loadtests.py index d655a4d1..82f85026 100644 --- a/nose2/plugins/loader/loadtests.py +++ b/nose2/plugins/loader/loadtests.py @@ -15,6 +15,7 @@ .. _load_tests protocol: http://docs.python.org/library/unittest.html#load-tests-protocol """ + import logging from fnmatch import fnmatch @@ -24,7 +25,6 @@ class LoadTestsLoader(events.Plugin): - """Loader plugin that implements load_tests.""" alwaysOn = True diff --git a/nose2/plugins/loader/parameters.py b/nose2/plugins/loader/parameters.py index f6e34b3c..4797faff 100644 --- a/nose2/plugins/loader/parameters.py +++ b/nose2/plugins/loader/parameters.py @@ -35,6 +35,7 @@ def testExtraArg(case, bar, foo): it.createTests(globals()) """ + # This module contains some code copied from unittest2 and other code # developed in reference to unittest2. # unittest2 is Copyright (c) 2001-2010 Python Software Foundation; All @@ -66,7 +67,6 @@ def __repr__(self): class Parameters(Plugin): - """Loader plugin that loads parameterized tests""" alwaysOn = True diff --git a/nose2/plugins/loader/testcases.py b/nose2/plugins/loader/testcases.py index fc0170e0..00cb70de 100644 --- a/nose2/plugins/loader/testcases.py +++ b/nose2/plugins/loader/testcases.py @@ -8,6 +8,7 @@ """ + # Adapted from unittest2/loader.py from the unittest2 plugins branch. # This module contains some code copied from unittest2/loader.py and other # code developed in reference to that module and others within unittest2. @@ -28,7 +29,6 @@ class TestCaseLoader(events.Plugin): - """Loader plugin that loads from test cases""" alwaysOn = True diff --git a/nose2/plugins/loader/testclasses.py b/nose2/plugins/loader/testclasses.py index b26b320e..30e4e190 100644 --- a/nose2/plugins/loader/testclasses.py +++ b/nose2/plugins/loader/testclasses.py @@ -79,7 +79,6 @@ def test(self): class TestClassLoader(events.Plugin): - """Loader plugin that loads test functions""" alwaysOn = True @@ -242,10 +241,8 @@ def shortDescription(self): class LoadFromTestClassEvent(events.LoadFromTestCaseEvent): - """Bare subclass of :class:`nose2.events.LoadFromTestCaseEvent`""" class GetTestMethodNamesEvent(events.GetTestCaseNamesEvent): - """Bare subclass of :class:`nose2.events.GetTestCaseNamesEvent`""" diff --git a/nose2/plugins/logcapture.py b/nose2/plugins/logcapture.py index 4a49cc7c..b019b058 100644 --- a/nose2/plugins/logcapture.py +++ b/nose2/plugins/logcapture.py @@ -9,6 +9,7 @@ raise exceptions. """ + import logging import threading from logging.handlers import BufferingHandler @@ -21,7 +22,6 @@ class LogCapture(Plugin): - """Capture log messages during test execution""" configSection = "log-capture" diff --git a/nose2/plugins/mp.py b/nose2/plugins/mp.py index d035bd96..f80b3930 100644 --- a/nose2/plugins/mp.py +++ b/nose2/plugins/mp.py @@ -403,7 +403,6 @@ def gentests(conn): # custom event classes class SubprocessEvent(events.Event): - """Event fired at start and end of subprocess execution. .. attribute :: loader @@ -445,7 +444,6 @@ def __init__(self, loader, result, runner, plugins, connection, **metadata): class RegisterInSubprocessEvent(events.Event): - """Event fired to notify plugins that multiprocess testing will occur .. attribute :: pluginClasses diff --git a/nose2/plugins/outcomes.py b/nose2/plugins/outcomes.py index 66a2d34c..0a6dc89d 100644 --- a/nose2/plugins/outcomes.py +++ b/nose2/plugins/outcomes.py @@ -24,7 +24,6 @@ class Outcomes(Plugin): - """Map exceptions to other test outcomes""" configSection = "outcomes" diff --git a/nose2/plugins/prettyassert.py b/nose2/plugins/prettyassert.py index 5a042b53..d923f6ca 100644 --- a/nose2/plugins/prettyassert.py +++ b/nose2/plugins/prettyassert.py @@ -10,7 +10,6 @@ """ - import collections import inspect import io diff --git a/nose2/plugins/printhooks.py b/nose2/plugins/printhooks.py index a03b9934..f6a9d510 100644 --- a/nose2/plugins/printhooks.py +++ b/nose2/plugins/printhooks.py @@ -11,6 +11,7 @@ instances of a :class:`~nose2.events.Hook` subclass that prints information about each call. """ + import sys from nose2 import events @@ -20,7 +21,6 @@ class PrintHooks(events.Plugin): - """Print hooks as they are called""" configSection = "print-hooks" diff --git a/nose2/plugins/prof.py b/nose2/plugins/prof.py index b9bcd246..4114cfe2 100644 --- a/nose2/plugins/prof.py +++ b/nose2/plugins/prof.py @@ -15,6 +15,7 @@ sections of the configuration file. """ + import cProfile import logging import pstats @@ -26,7 +27,6 @@ class Profiler(events.Plugin): - """Profile the test run""" configSection = "profiler" diff --git a/nose2/plugins/result.py b/nose2/plugins/result.py index fb95ec7a..e13282d7 100644 --- a/nose2/plugins/result.py +++ b/nose2/plugins/result.py @@ -20,6 +20,7 @@ same job, or (b) really don't want any test results (and want all test runs to ``exit(1)``). """ + # This module contains some code copied from unittest2/runner.py and other # code developed in reference to that module and others within unittest2. # unittest2 is Copyright (c) 2001-2010 Python Software Foundation; All @@ -34,7 +35,6 @@ class ResultReporter(events.Plugin): - """Result plugin that implements standard unittest console reporting""" alwaysOn = True diff --git a/nose2/plugins/testid.py b/nose2/plugins/testid.py index 5e40f452..646bcb25 100644 --- a/nose2/plugins/testid.py +++ b/nose2/plugins/testid.py @@ -10,6 +10,7 @@ :func:`stopTest`. """ + import os import pickle import re @@ -21,7 +22,6 @@ class TestId(Plugin): - """Allow easy test select with ids""" configSection = "testid" diff --git a/nose2/result.py b/nose2/result.py index fe19e8b1..4fd5e73d 100644 --- a/nose2/result.py +++ b/nose2/result.py @@ -11,7 +11,6 @@ class PluggableTestResult: - """Test result that defers to plugins. All test outcome recording and reporting is deferred to plugins, diff --git a/nose2/runner.py b/nose2/runner.py index f68489f3..4790e897 100644 --- a/nose2/runner.py +++ b/nose2/runner.py @@ -11,7 +11,6 @@ class PluggableTestRunner: - """Test runner that defers most work to plugins. :param session: Test run session diff --git a/nose2/session.py b/nose2/session.py index 1078a0c3..ed171ec3 100644 --- a/nose2/session.py +++ b/nose2/session.py @@ -12,7 +12,6 @@ class Session: - """Configuration session. Encapsulates all configuration for a given test run. diff --git a/nose2/tests/_common.py b/nose2/tests/_common.py index c6ee4338..fe27b0a8 100644 --- a/nose2/tests/_common.py +++ b/nose2/tests/_common.py @@ -1,4 +1,5 @@ """Common functionality.""" + import io import os.path import platform @@ -15,7 +16,6 @@ class TestCase(unittest.TestCase): - """TestCase extension. If the class variable ``_RUN_IN_TEMP`` is ``True`` (default: ``False``), tests will @@ -89,7 +89,6 @@ def runModuleAsMain(self, testmodule, *args): class _FakeEventBase: - """Baseclass for fake :class:`~nose2.events.Event`s.""" def __init__(self): @@ -99,7 +98,6 @@ def __init__(self): class FakeHandleFileEvent(_FakeEventBase): - """Fake HandleFileEvent.""" def __init__(self, name): @@ -112,7 +110,6 @@ def __init__(self, name): class FakeStartTestEvent(_FakeEventBase): - """Fake :class:`~nose2.events.StartTestEvent`.""" def __init__(self, test): @@ -125,7 +122,6 @@ def __init__(self, test): class FakeLoadFromNameEvent(_FakeEventBase): - """Fake :class:`~nose2.events.LoadFromNameEvent`.""" def __init__(self, name): @@ -134,7 +130,6 @@ def __init__(self, name): class FakeLoadFromNamesEvent(_FakeEventBase): - """Fake :class:`~nose2.events.LoadFromNamesEvent`.""" def __init__(self, names): @@ -143,7 +138,6 @@ def __init__(self, names): class FakeStartTestRunEvent(_FakeEventBase): - """Fake :class:`~nose2.events.StartTestRunEvent`""" def __init__( @@ -158,7 +152,6 @@ def __init__( class Stub: - """Stub object for use in tests""" def __getattr__(self, attr): @@ -238,7 +231,6 @@ def poll(self): class RedirectStdStreams: - """ Context manager that replaces the stdin/stdout streams with :class:`StringIO` buffers. diff --git a/nose2/tests/functional/test_loading.py b/nose2/tests/functional/test_loading.py index 38239cc1..1f64b532 100644 --- a/nose2/tests/functional/test_loading.py +++ b/nose2/tests/functional/test_loading.py @@ -17,6 +17,7 @@ # param method index """ + from nose2.tests._common import FunctionalTestCase, support_file diff --git a/nose2/tests/unit/test_doctest_plugin.py b/nose2/tests/unit/test_doctest_plugin.py index 42072eb5..b316c33e 100644 --- a/nose2/tests/unit/test_doctest_plugin.py +++ b/nose2/tests/unit/test_doctest_plugin.py @@ -1,4 +1,5 @@ """Test doctests plugin.""" + import doctest from textwrap import dedent @@ -8,7 +9,6 @@ class UnitTestDocTestLoader(TestCase): - """Test class DocTestLoader.""" tags = ["unit"] diff --git a/nose2/tests/unit/test_testid_plugin.py b/nose2/tests/unit/test_testid_plugin.py index 91ce09a6..a91c4355 100644 --- a/nose2/tests/unit/test_testid_plugin.py +++ b/nose2/tests/unit/test_testid_plugin.py @@ -1,4 +1,5 @@ """Test testid plugin.""" + import io import os.path import pickle @@ -15,7 +16,6 @@ class UnitTestTestId(TestCase): - """Test class TestId. Tests are carried out in a temporary directory, since TestId stores state diff --git a/nose2/tools/params.py b/nose2/tools/params.py index 05d7ab13..c597dbe5 100644 --- a/nose2/tools/params.py +++ b/nose2/tools/params.py @@ -6,6 +6,7 @@ Rights Reserved. See: http://docs.python.org/license.html """ + import itertools __unittest = True diff --git a/nose2/tools/such.py b/nose2/tools/such.py index 526b3a76..0bbfffad 100644 --- a/nose2/tools/such.py +++ b/nose2/tools/such.py @@ -41,7 +41,6 @@ def runTest(self): class Scenario: - """A test scenario. A test scenario defines a set of fixtures and tests @@ -339,7 +338,6 @@ def tearDown(cls): class Group: - """A group of tests, with common fixtures and description""" def __init__(self, description, indent=0, parent=None, base_layer=None): @@ -389,7 +387,6 @@ def child(self, description, base_layer=None): class Case: - """Information about a test case""" _helper = helper diff --git a/nose2/util.py b/nose2/util.py index 78688371..88af2e6e 100644 --- a/nose2/util.py +++ b/nose2/util.py @@ -328,7 +328,6 @@ def _count_relevant_tb_levels(tb): class _WritelnDecorator: - """Used to decorate file-like objects with a handy :func:`writeln` method""" def __init__(self, stream):