From a21157f8959c4f1b8907656dc88631481ba546e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Fri, 19 Dec 2025 11:01:42 +0000 Subject: [PATCH] Move tests out of testtools/ --- .github/workflows/test.yml | 2 +- .testr.conf | 2 +- Makefile | 2 +- doc/hacking.rst | 2 +- pyproject.toml | 4 ++-- scripts/all-pythons | 2 +- {testtools/tests => tests}/__init__.py | 2 +- {testtools/tests => tests}/helpers.py | 0 .../tests => tests}/matchers/__init__.py | 2 +- .../tests => tests}/matchers/helpers.py | 0 .../tests => tests}/matchers/test_basic.py | 5 ++-- .../tests => tests}/matchers/test_const.py | 3 ++- .../matchers/test_datastructures.py | 5 ++-- .../tests => tests}/matchers/test_dict.py | 3 ++- .../tests => tests}/matchers/test_doctest.py | 5 ++-- .../matchers/test_exception.py | 5 ++-- .../matchers/test_filesystem.py | 0 .../matchers/test_higherorder.py | 5 ++-- .../tests => tests}/matchers/test_impl.py | 3 ++- .../tests => tests}/matchers/test_warnings.py | 5 ++-- {testtools/tests => tests}/samplecases.py | 0 .../tests => tests}/test_assert_that.py | 0 {testtools/tests => tests}/test_compat.py | 0 {testtools/tests => tests}/test_content.py | 3 ++- .../tests => tests}/test_content_type.py | 0 .../tests => tests}/test_fixturesupport.py | 0 {testtools/tests => tests}/test_helpers.py | 3 ++- {testtools/tests => tests}/test_monkey.py | 0 {testtools/tests => tests}/test_run.py | 0 {testtools/tests => tests}/test_runtest.py | 3 ++- {testtools/tests => tests}/test_tags.py | 0 {testtools/tests => tests}/test_testcase.py | 23 ++++++++----------- {testtools/tests => tests}/test_testresult.py | 23 ++++++++++--------- {testtools/tests => tests}/test_testsuite.py | 11 +++++---- {testtools/tests => tests}/test_with_with.py | 0 .../twistedsupport/__init__.py | 2 +- .../twistedsupport/_helpers.py | 0 .../twistedsupport/test_deferred.py | 0 .../twistedsupport/test_matchers.py | 0 .../twistedsupport/test_runtest.py | 4 ++-- .../twistedsupport/test_spinner.py | 0 testtools/run.py | 2 +- tox.ini | 2 +- 43 files changed, 72 insertions(+), 61 deletions(-) rename {testtools/tests => tests}/__init__.py (96%) rename {testtools/tests => tests}/helpers.py (100%) rename {testtools/tests => tests}/matchers/__init__.py (94%) rename {testtools/tests => tests}/matchers/helpers.py (100%) rename {testtools/tests => tests}/matchers/test_basic.py (99%) rename {testtools/tests => tests}/matchers/test_const.py (93%) rename {testtools/tests => tests}/matchers/test_datastructures.py (98%) rename {testtools/tests => tests}/matchers/test_dict.py (99%) rename {testtools/tests => tests}/matchers/test_doctest.py (95%) rename {testtools/tests => tests}/matchers/test_exception.py (98%) rename {testtools/tests => tests}/matchers/test_filesystem.py (100%) rename {testtools/tests => tests}/matchers/test_higherorder.py (98%) rename {testtools/tests => tests}/matchers/test_impl.py (98%) rename {testtools/tests => tests}/matchers/test_warnings.py (98%) rename {testtools/tests => tests}/samplecases.py (100%) rename {testtools/tests => tests}/test_assert_that.py (100%) rename {testtools/tests => tests}/test_compat.py (100%) rename {testtools/tests => tests}/test_content.py (99%) rename {testtools/tests => tests}/test_content_type.py (100%) rename {testtools/tests => tests}/test_fixturesupport.py (100%) rename {testtools/tests => tests}/test_helpers.py (95%) rename {testtools/tests => tests}/test_monkey.py (100%) rename {testtools/tests => tests}/test_run.py (100%) rename {testtools/tests => tests}/test_runtest.py (99%) rename {testtools/tests => tests}/test_tags.py (100%) rename {testtools/tests => tests}/test_testcase.py (99%) rename {testtools/tests => tests}/test_testresult.py (99%) rename {testtools/tests => tests}/test_testsuite.py (97%) rename {testtools/tests => tests}/test_with_with.py (100%) rename {testtools/tests => tests}/twistedsupport/__init__.py (89%) rename {testtools/tests => tests}/twistedsupport/_helpers.py (100%) rename {testtools/tests => tests}/twistedsupport/test_deferred.py (100%) rename {testtools/tests => tests}/twistedsupport/test_matchers.py (100%) rename {testtools/tests => tests}/twistedsupport/test_runtest.py (99%) rename {testtools/tests => tests}/twistedsupport/test_spinner.py (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2733820d..b19aa548 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,7 @@ jobs: - name: Run tests run: | - python -W once -m testtools.run testtools.tests.test_suite + python -W once -m testtools.run tests.test_suite docs: runs-on: ubuntu-latest diff --git a/.testr.conf b/.testr.conf index 18013703..5377aa16 100644 --- a/.testr.conf +++ b/.testr.conf @@ -1,4 +1,4 @@ [DEFAULT] -test_command=${PYTHON:-python3} -m subunit.run $LISTOPT $IDOPTION testtools.tests.test_suite +test_command=${PYTHON:-python3} -m subunit.run $LISTOPT $IDOPTION tests.test_suite test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/Makefile b/Makefile index b5b783fe..db73b951 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PYTHON=python3 SOURCES=$(shell find testtools -name "*.py") check: - PYTHONPATH=$(PWD) $(PYTHON) -m testtools.run testtools.tests.test_suite + PYTHONPATH=$(PWD) $(PYTHON) -m testtools.run tests.test_suite TAGS: ${SOURCES} ctags -e -R testtools/ diff --git a/doc/hacking.rst b/doc/hacking.rst index c407d63e..63b03744 100644 --- a/doc/hacking.rst +++ b/doc/hacking.rst @@ -103,7 +103,7 @@ Users of testtools should never import a submodule in order to use a stable API. Unstable APIs like ``testtools.matchers`` and ``testtools.deferredruntest`` should be exported as submodules. -Tests belong in ``testtools/tests/``. +Tests belong in ``tests/``. Committing to trunk diff --git a/pyproject.toml b/pyproject.toml index d240edab..cc93902a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,7 +78,7 @@ ignore_missing_imports = true [[tool.mypy.overrides]] module = [ # FIXME(stephenfin): We would like to remove all modules from this list - # except testtools.tests (we're not sadists) + # except tests (we're not sadists) "testtools.assertions", "testtools.compat", "testtools.content", @@ -91,7 +91,7 @@ module = [ "testtools.testresult.*", "testtools.testsuite", "testtools.twistedsupport.*", - "testtools.tests.*", + "tests.*", ] disallow_untyped_calls = false disallow_untyped_defs = false diff --git a/scripts/all-pythons b/scripts/all-pythons index 18a9fb1b..96b156b0 100755 --- a/scripts/all-pythons +++ b/scripts/all-pythons @@ -31,7 +31,7 @@ ROOT = os.path.dirname(os.path.dirname(__file__)) def run_for_python(version, result, tests): if not tests: - tests = ['testtools.tests.test_suite'] + tests = ['tests.test_suite'] # XXX: This could probably be broken up and put into subunit. python = 'python%s' % (version,) # XXX: Correct API, but subunit doesn't support it. :( diff --git a/testtools/tests/__init__.py b/tests/__init__.py similarity index 96% rename from testtools/tests/__init__.py rename to tests/__init__.py index 7859ef2e..650c8933 100644 --- a/testtools/tests/__init__.py +++ b/tests/__init__.py @@ -8,7 +8,7 @@ def test_suite(): - from testtools.tests import ( + from . import ( matchers, test_assert_that, test_compat, diff --git a/testtools/tests/helpers.py b/tests/helpers.py similarity index 100% rename from testtools/tests/helpers.py rename to tests/helpers.py diff --git a/testtools/tests/matchers/__init__.py b/tests/matchers/__init__.py similarity index 94% rename from testtools/tests/matchers/__init__.py rename to tests/matchers/__init__.py index 8deaa497..c0d6eea2 100644 --- a/testtools/tests/matchers/__init__.py +++ b/tests/matchers/__init__.py @@ -5,7 +5,7 @@ def test_suite(): - from testtools.tests.matchers import ( + from ..matchers import ( test_basic, test_const, test_datastructures, diff --git a/testtools/tests/matchers/helpers.py b/tests/matchers/helpers.py similarity index 100% rename from testtools/tests/matchers/helpers.py rename to tests/matchers/helpers.py diff --git a/testtools/tests/matchers/test_basic.py b/tests/matchers/test_basic.py similarity index 99% rename from testtools/tests/matchers/test_basic.py rename to tests/matchers/test_basic.py index f7bd3da3..07aa83c9 100644 --- a/testtools/tests/matchers/test_basic.py +++ b/tests/matchers/test_basic.py @@ -27,8 +27,9 @@ _BinaryMismatch, _NotNearlyEqual, ) -from testtools.tests.helpers import FullStackRunTest -from testtools.tests.matchers.helpers import TestMatchersInterface + +from ..helpers import FullStackRunTest +from ..matchers.helpers import TestMatchersInterface class Test_BinaryMismatch(TestCase): diff --git a/testtools/tests/matchers/test_const.py b/tests/matchers/test_const.py similarity index 93% rename from testtools/tests/matchers/test_const.py rename to tests/matchers/test_const.py index 209c74d3..2f1eee46 100644 --- a/testtools/tests/matchers/test_const.py +++ b/tests/matchers/test_const.py @@ -4,7 +4,8 @@ from testtools import TestCase from testtools.matchers import Always, Never -from testtools.tests.matchers.helpers import TestMatchersInterface + +from ..matchers.helpers import TestMatchersInterface class TestAlwaysInterface(TestMatchersInterface, TestCase): diff --git a/testtools/tests/matchers/test_datastructures.py b/tests/matchers/test_datastructures.py similarity index 98% rename from testtools/tests/matchers/test_datastructures.py rename to tests/matchers/test_datastructures.py index 13253ee6..02c1c8f2 100644 --- a/testtools/tests/matchers/test_datastructures.py +++ b/tests/matchers/test_datastructures.py @@ -20,8 +20,9 @@ MatchesSetwise, MatchesStructure, ) -from testtools.tests.helpers import FullStackRunTest -from testtools.tests.matchers.helpers import TestMatchersInterface + +from ..helpers import FullStackRunTest +from ..matchers.helpers import TestMatchersInterface def run_doctest(obj, name): diff --git a/testtools/tests/matchers/test_dict.py b/tests/matchers/test_dict.py similarity index 99% rename from testtools/tests/matchers/test_dict.py rename to tests/matchers/test_dict.py index c0431793..43dc843c 100644 --- a/testtools/tests/matchers/test_dict.py +++ b/tests/matchers/test_dict.py @@ -14,7 +14,8 @@ MatchesDict, _SubDictOf, ) -from testtools.tests.matchers.helpers import TestMatchersInterface + +from ..matchers.helpers import TestMatchersInterface class TestMatchesAllDictInterface(TestCase, TestMatchersInterface): diff --git a/testtools/tests/matchers/test_doctest.py b/tests/matchers/test_doctest.py similarity index 95% rename from testtools/tests/matchers/test_doctest.py rename to tests/matchers/test_doctest.py index 975d9733..f413d88c 100644 --- a/testtools/tests/matchers/test_doctest.py +++ b/tests/matchers/test_doctest.py @@ -8,8 +8,9 @@ _b, ) from testtools.matchers._doctest import DocTestMatches -from testtools.tests.helpers import FullStackRunTest -from testtools.tests.matchers.helpers import TestMatchersInterface + +from ..helpers import FullStackRunTest +from ..matchers.helpers import TestMatchersInterface class TestDocTestMatchesInterface(TestCase, TestMatchersInterface): diff --git a/testtools/tests/matchers/test_exception.py b/tests/matchers/test_exception.py similarity index 98% rename from testtools/tests/matchers/test_exception.py rename to tests/matchers/test_exception.py index 770dd032..43472b51 100644 --- a/testtools/tests/matchers/test_exception.py +++ b/tests/matchers/test_exception.py @@ -13,8 +13,9 @@ Raises, raises, ) -from testtools.tests.helpers import FullStackRunTest -from testtools.tests.matchers.helpers import TestMatchersInterface + +from ..helpers import FullStackRunTest +from ..matchers.helpers import TestMatchersInterface def make_error(type, *args, **kwargs): diff --git a/testtools/tests/matchers/test_filesystem.py b/tests/matchers/test_filesystem.py similarity index 100% rename from testtools/tests/matchers/test_filesystem.py rename to tests/matchers/test_filesystem.py diff --git a/testtools/tests/matchers/test_higherorder.py b/tests/matchers/test_higherorder.py similarity index 98% rename from testtools/tests/matchers/test_higherorder.py rename to tests/matchers/test_higherorder.py index 35d57864..8d35c82f 100644 --- a/testtools/tests/matchers/test_higherorder.py +++ b/tests/matchers/test_higherorder.py @@ -23,8 +23,9 @@ MatchesPredicateWithParams, Not, ) -from testtools.tests.helpers import FullStackRunTest -from testtools.tests.matchers.helpers import TestMatchersInterface + +from ..helpers import FullStackRunTest +from ..matchers.helpers import TestMatchersInterface class TestAllMatch(TestCase, TestMatchersInterface): diff --git a/testtools/tests/matchers/test_impl.py b/tests/matchers/test_impl.py similarity index 98% rename from testtools/tests/matchers/test_impl.py rename to tests/matchers/test_impl.py index 6d2ad7d5..4670e171 100644 --- a/testtools/tests/matchers/test_impl.py +++ b/tests/matchers/test_impl.py @@ -19,7 +19,8 @@ MismatchDecorator, MismatchError, ) -from testtools.tests.helpers import FullStackRunTest + +from ..helpers import FullStackRunTest # Silence pyflakes. Matcher diff --git a/testtools/tests/matchers/test_warnings.py b/tests/matchers/test_warnings.py similarity index 98% rename from testtools/tests/matchers/test_warnings.py rename to tests/matchers/test_warnings.py index eb101347..56616318 100644 --- a/testtools/tests/matchers/test_warnings.py +++ b/tests/matchers/test_warnings.py @@ -13,8 +13,9 @@ MatchesStructure, ) from testtools.matchers._warnings import IsDeprecated, WarningMessage, Warnings -from testtools.tests.helpers import FullStackRunTest -from testtools.tests.matchers.helpers import TestMatchersInterface + +from ..helpers import FullStackRunTest +from ..matchers.helpers import TestMatchersInterface def make_warning(warning_type, message): diff --git a/testtools/tests/samplecases.py b/tests/samplecases.py similarity index 100% rename from testtools/tests/samplecases.py rename to tests/samplecases.py diff --git a/testtools/tests/test_assert_that.py b/tests/test_assert_that.py similarity index 100% rename from testtools/tests/test_assert_that.py rename to tests/test_assert_that.py diff --git a/testtools/tests/test_compat.py b/tests/test_compat.py similarity index 100% rename from testtools/tests/test_compat.py rename to tests/test_compat.py diff --git a/testtools/tests/test_content.py b/tests/test_content.py similarity index 99% rename from testtools/tests/test_content.py rename to tests/test_content.py index 8619bda7..d377346e 100644 --- a/testtools/tests/test_content.py +++ b/tests/test_content.py @@ -32,7 +32,8 @@ Raises, raises, ) -from testtools.tests.helpers import an_exc_info + +from .helpers import an_exc_info raises_value_error = Raises(MatchesException(ValueError)) diff --git a/testtools/tests/test_content_type.py b/tests/test_content_type.py similarity index 100% rename from testtools/tests/test_content_type.py rename to tests/test_content_type.py diff --git a/testtools/tests/test_fixturesupport.py b/tests/test_fixturesupport.py similarity index 100% rename from testtools/tests/test_fixturesupport.py rename to tests/test_fixturesupport.py diff --git a/testtools/tests/test_helpers.py b/tests/test_helpers.py similarity index 95% rename from testtools/tests/test_helpers.py rename to tests/test_helpers.py index 67bed8ab..4217fb08 100644 --- a/testtools/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -1,7 +1,8 @@ # Copyright (c) 2010-2012 testtools developers. See LICENSE for details. from testtools import TestCase -from testtools.tests.helpers import ( + +from .helpers import ( FullStackRunTest, hide_testtools_stack, is_stack_hidden, diff --git a/testtools/tests/test_monkey.py b/tests/test_monkey.py similarity index 100% rename from testtools/tests/test_monkey.py rename to tests/test_monkey.py diff --git a/testtools/tests/test_run.py b/tests/test_run.py similarity index 100% rename from testtools/tests/test_run.py rename to tests/test_run.py diff --git a/testtools/tests/test_runtest.py b/tests/test_runtest.py similarity index 99% rename from testtools/tests/test_runtest.py rename to tests/test_runtest.py index 78f4fe81..f41b71ea 100644 --- a/testtools/tests/test_runtest.py +++ b/tests/test_runtest.py @@ -13,7 +13,8 @@ ) from testtools.matchers import HasLength, Is, MatchesException, Raises from testtools.testresult.doubles import ExtendedTestResult -from testtools.tests.helpers import FullStackRunTest + +from .helpers import FullStackRunTest class TestRunTest(TestCase): diff --git a/testtools/tests/test_tags.py b/tests/test_tags.py similarity index 100% rename from testtools/tests/test_tags.py rename to tests/test_tags.py diff --git a/testtools/tests/test_testcase.py b/tests/test_testcase.py similarity index 99% rename from testtools/tests/test_testcase.py rename to tests/test_testcase.py index c304af6a..9340f73d 100644 --- a/testtools/tests/test_testcase.py +++ b/tests/test_testcase.py @@ -47,7 +47,8 @@ ExtendedTestResult, Python3TestResult, ) -from testtools.tests.helpers import ( + +from .helpers import ( AsText, FullStackRunTest, LoggingResult, @@ -55,7 +56,7 @@ an_exc_info, raise_, ) -from testtools.tests.samplecases import ( +from .samplecases import ( deterministic_sample_cases_scenarios, make_case_for_behavior_scenario, make_test_case, @@ -1602,7 +1603,7 @@ def test_method(self): self.assertThat( result.errors[0][1], DocTestMatches( - "...ValueError...File...testtools/tests/test_testcase.py...", ELLIPSIS + "...ValueError...File...tests/test_testcase.py...", ELLIPSIS ), ) @@ -1620,7 +1621,7 @@ def test_method(self): self.assertThat( result.errors[0][1], DocTestMatches( - "...ValueError...File...testtools/tests/test_testcase.py...", ELLIPSIS + "...ValueError...File...tests/test_testcase.py...", ELLIPSIS ), ) @@ -1635,7 +1636,7 @@ def test_method(self): self.assertThat( result.errors[0][1], DocTestMatches( - "...ValueError...File...testtools/tests/test_testcase.py...", ELLIPSIS + "...ValueError...File...tests/test_testcase.py...", ELLIPSIS ), ) @@ -1653,7 +1654,7 @@ def tearDown(self): self.assertThat( result.errors[0][1], DocTestMatches( - "...ValueError...File...testtools/tests/test_testcase.py...", ELLIPSIS + "...ValueError...File...tests/test_testcase.py...", ELLIPSIS ), ) @@ -2219,20 +2220,16 @@ class TestAttributes(TestCase): def test_simple_attr(self): # Adding an attr to a test changes its id(). case = Attributes("simple") - self.assertEqual( - "testtools.tests.test_testcase.Attributes.simple[foo]", case.id() - ) + self.assertEqual("tests.test_testcase.Attributes.simple[foo]", case.id()) def test_multiple_attributes(self): case = Attributes("many") - self.assertEqual( - "testtools.tests.test_testcase.Attributes.many[bar,foo,quux]", case.id() - ) + self.assertEqual("tests.test_testcase.Attributes.many[bar,foo,quux]", case.id()) def test_multiple_attr_decorators(self): case = Attributes("decorated") self.assertEqual( - "testtools.tests.test_testcase.Attributes.decorated[bar,foo,quux]", + "tests.test_testcase.Attributes.decorated[bar,foo,quux]", case.id(), ) diff --git a/testtools/tests/test_testresult.py b/tests/test_testresult.py similarity index 99% rename from testtools/tests/test_testresult.py rename to tests/test_testresult.py index 69265f87..3ed29f7e 100644 --- a/testtools/tests/test_testresult.py +++ b/tests/test_testresult.py @@ -79,7 +79,8 @@ _merge_tags, utc, ) -from testtools.tests.helpers import ( + +from .helpers import ( FullStackRunTest, LoggingResult, an_exc_info, @@ -1219,7 +1220,7 @@ def test_explicit_time(self): ("startTestRun",), ( "status", - "testtools.tests.test_testresult.TestExtendedToStreamDecorator.test_explicit_time", + "tests.test_testresult.TestExtendedToStreamDecorator.test_explicit_time", "inprogress", None, True, @@ -1232,7 +1233,7 @@ def test_explicit_time(self): ), ( "status", - "testtools.tests.test_testresult.TestExtendedToStreamDecorator.test_explicit_time", + "tests.test_testresult.TestExtendedToStreamDecorator.test_explicit_time", "success", set(), True, @@ -1271,7 +1272,7 @@ def test_empty_detail_status_correct(self): ("startTestRun",), ( "status", - "testtools.tests.test_testresult.TestExtendedToStreamDecorator.test_empty_detail_status_correct", + "tests.test_testresult.TestExtendedToStreamDecorator.test_empty_detail_status_correct", "inprogress", None, True, @@ -1284,7 +1285,7 @@ def test_empty_detail_status_correct(self): ), ( "status", - "testtools.tests.test_testresult.TestExtendedToStreamDecorator.test_empty_detail_status_correct", + "tests.test_testresult.TestExtendedToStreamDecorator.test_empty_detail_status_correct", None, None, True, @@ -1297,7 +1298,7 @@ def test_empty_detail_status_correct(self): ), ( "status", - "testtools.tests.test_testresult.TestExtendedToStreamDecorator.test_empty_detail_status_correct", + "tests.test_testresult.TestExtendedToStreamDecorator.test_empty_detail_status_correct", "fail", set(), True, @@ -1528,7 +1529,7 @@ def _report_files(self, result): file_name="traceback", file_bytes=_b( """Traceback (most recent call last): - File "testtools/tests/test_testresult.py", line 607, in test_stopTestRun + File "tests/test_testresult.py", line 607, in test_stopTestRun AllMatch(Equals([('startTestRun',), ('stopTestRun',)]))) testtools.matchers._impl.MismatchError: Differences: [ [('startTestRun',), ('stopTestRun',)] != [] @@ -1545,7 +1546,7 @@ def _report_files(self, result): """some log.txt: {{{1234 log message}}} Traceback (most recent call last): - File "testtools/tests/test_testresult.py", line 607, in test_stopTestRun + File "tests/test_testresult.py", line 607, in test_stopTestRun AllMatch(Equals([('startTestRun',), ('stopTestRun',)]))) testtools.matchers._impl.MismatchError: Differences: [ [('startTestRun',), ('stopTestRun',)] != [] @@ -2056,21 +2057,21 @@ def run_tests(): self.getvalue(), DocTestMatches( """...====================================================================== -ERROR: testtools.tests.test_testresult.Test.error +ERROR: tests.test_testresult.Test.error ---------------------------------------------------------------------- Traceback (most recent call last): File "...testtools...tests...test_testresult.py", line ..., in error 1 / 0 ZeroDivisionError:... divi... by zero... ====================================================================== -FAIL: testtools.tests.test_testresult.Test.failed +FAIL: tests.test_testresult.Test.failed ---------------------------------------------------------------------- Traceback (most recent call last): File "...testtools...tests...test_testresult.py", line ..., in failed self.fail("yo!") AssertionError: yo! ====================================================================== -UNEXPECTED SUCCESS: testtools.tests.test_testresult.Test.succeeded +UNEXPECTED SUCCESS: tests.test_testresult.Test.succeeded ---------------------------------------------------------------------- ...""", doctest.ELLIPSIS | doctest.REPORT_NDIFF, diff --git a/testtools/tests/test_testsuite.py b/tests/test_testsuite.py similarity index 97% rename from testtools/tests/test_testsuite.py rename to tests/test_testsuite.py index 565b7cdb..71428281 100644 --- a/testtools/tests/test_testsuite.py +++ b/tests/test_testsuite.py @@ -16,9 +16,10 @@ ) from testtools.matchers import DocTestMatches, Equals from testtools.testresult.doubles import StreamResult as LoggingStream -from testtools.tests.helpers import LoggingResult from testtools.testsuite import FixtureSuite, sorted_tests +from .helpers import LoggingResult + try: from fixtures import FunctionFixture except ImportError: @@ -127,7 +128,7 @@ def freeze(set_or_none): { ( "status", - "testtools.tests.test_testsuite.Sample.test_method1", + "tests.test_testsuite.Sample.test_method1", "inprogress", None, True, @@ -140,7 +141,7 @@ def freeze(set_or_none): ), ( "status", - "testtools.tests.test_testsuite.Sample.test_method1", + "tests.test_testsuite.Sample.test_method1", "success", frozenset(), True, @@ -153,7 +154,7 @@ def freeze(set_or_none): ), ( "status", - "testtools.tests.test_testsuite.Sample.test_method2", + "tests.test_testsuite.Sample.test_method2", "inprogress", None, True, @@ -166,7 +167,7 @@ def freeze(set_or_none): ), ( "status", - "testtools.tests.test_testsuite.Sample.test_method2", + "tests.test_testsuite.Sample.test_method2", "success", frozenset(), True, diff --git a/testtools/tests/test_with_with.py b/tests/test_with_with.py similarity index 100% rename from testtools/tests/test_with_with.py rename to tests/test_with_with.py diff --git a/testtools/tests/twistedsupport/__init__.py b/tests/twistedsupport/__init__.py similarity index 89% rename from testtools/tests/twistedsupport/__init__.py rename to tests/twistedsupport/__init__.py index c8b52868..39a1e444 100644 --- a/testtools/tests/twistedsupport/__init__.py +++ b/tests/twistedsupport/__init__.py @@ -4,7 +4,7 @@ def test_suite(): - from testtools.tests.twistedsupport import ( + from . import ( test_deferred, test_matchers, test_runtest, diff --git a/testtools/tests/twistedsupport/_helpers.py b/tests/twistedsupport/_helpers.py similarity index 100% rename from testtools/tests/twistedsupport/_helpers.py rename to tests/twistedsupport/_helpers.py diff --git a/testtools/tests/twistedsupport/test_deferred.py b/tests/twistedsupport/test_deferred.py similarity index 100% rename from testtools/tests/twistedsupport/test_deferred.py rename to tests/twistedsupport/test_deferred.py diff --git a/testtools/tests/twistedsupport/test_matchers.py b/tests/twistedsupport/test_matchers.py similarity index 100% rename from testtools/tests/twistedsupport/test_matchers.py rename to tests/twistedsupport/test_matchers.py diff --git a/testtools/tests/twistedsupport/test_runtest.py b/tests/twistedsupport/test_runtest.py similarity index 99% rename from testtools/tests/twistedsupport/test_runtest.py rename to tests/twistedsupport/test_runtest.py index b70a8048..ab92a691 100644 --- a/testtools/tests/twistedsupport/test_runtest.py +++ b/tests/twistedsupport/test_runtest.py @@ -25,11 +25,11 @@ ) from testtools.runtest import RunTest from testtools.testresult.doubles import ExtendedTestResult -from testtools.tests.helpers import ( + +from ..helpers import ( AsText, MatchesEvents, ) - from ._helpers import NeedsTwistedTestCase try: diff --git a/testtools/tests/twistedsupport/test_spinner.py b/tests/twistedsupport/test_spinner.py similarity index 100% rename from testtools/tests/twistedsupport/test_spinner.py rename to tests/twistedsupport/test_spinner.py diff --git a/testtools/run.py b/testtools/run.py index 7ae3ec86..97ae6fd8 100755 --- a/testtools/run.py +++ b/testtools/run.py @@ -5,7 +5,7 @@ Run some tests with the testtools extended API. For instance, to run the testtools test suite. - $ python -m testtools.run testtools.tests.test_suite + $ python -m testtools.run tests.test_suite """ import os.path diff --git a/tox.ini b/tox.ini index 0c708219..6cf33bac 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ extras = test twisted commands = - python -W once -m testtools.run testtools.tests.test_suite {posargs} + python -W once -m testtools.run tests.test_suite {posargs} [testenv:ruff] deps =