Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ perl/MYMETA.json
python/python_subunit.egg-info/
test-driver
ar-lib
*.o
*.log
*.trs
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Code that has been incorporated into Subunit from other projects will
naturally be under its own license, and will retain that license.

A known list of such code is maintained here:
* The runtests.py and python/subunit/tests/TestUtil.py module are GPL test
* The runtests.py and python/tests/TestUtil.py module are GPL test
support modules. They are not installed by Subunit - they are only ever
used on the build machine. Copyright 2004 Canonical Limited.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ exclude py-compile
prune shell
exclude stamp-h1
include NEWS
recursive-include python/tests *.py
34 changes: 17 additions & 17 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ EXTRA_DIST = \
c/check-subunit-0.9.3.patch \
c/check-subunit-0.9.5.patch \
c/check-subunit-0.9.6.patch \
python/subunit/tests/__init__.py \
python/subunit/tests/sample-script.py \
python/subunit/tests/sample-two-script.py \
python/subunit/tests/test_chunked.py \
python/subunit/tests/test_details.py \
python/subunit/tests/test_filters.py \
python/subunit/tests/test_filter_to_disk.py \
python/subunit/tests/test_output_filter.py \
python/subunit/tests/test_progress_model.py \
python/subunit/tests/test_run.py \
python/subunit/tests/test_subunit_filter.py \
python/subunit/tests/test_subunit_stats.py \
python/subunit/tests/test_subunit_tags.py \
python/subunit/tests/test_tap2subunit.py \
python/subunit/tests/test_test_protocol.py \
python/subunit/tests/test_test_protocol2.py \
python/subunit/tests/test_test_results.py \
python/tests/__init__.py \
python/tests/sample-script.py \
python/tests/sample-two-script.py \
python/tests/test_chunked.py \
python/tests/test_details.py \
python/tests/test_filters.py \
python/tests/test_filter_to_disk.py \
python/tests/test_output_filter.py \
python/tests/test_progress_model.py \
python/tests/test_run.py \
python/tests/test_subunit_filter.py \
python/tests/test_subunit_stats.py \
python/tests/test_subunit_tags.py \
python/tests/test_tap2subunit.py \
python/tests/test_test_protocol.py \
python/tests/test_test_protocol2.py \
python/tests/test_test_results.py \
python/subunit/filter_scripts/__init__.py \
python/subunit/filter_scripts/subunit_1to2.py \
python/subunit/filter_scripts/subunit2csv.py \
Expand Down
8 changes: 8 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
subunit release notes
---------------------

1.4.6 (UNRELEASED)
---------------------

IMPROVEMENTS
~~~~~~~~~~~~

* Stop installing tests. (Jelmer Vernooij)

1.4.5 (2025-11-10)
---------------------

Expand Down
3 changes: 2 additions & 1 deletion all_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import unittest

import subunit
import tests


class ShellTests(subunit.ExecTestCase):
Expand All @@ -29,7 +30,7 @@ def test_functions(self):

def test_suite():
result = unittest.TestSuite()
result.addTest(subunit.test_suite())
result.addTest(tests.test_suite())
result.addTest(ShellTests("test_sourcing"))
result.addTest(ShellTests("test_functions"))
return result
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ requires = ["iso8601", "setuptools>=61.2", "testtools"]
[tool.ruff]
line-length = 120

[[tool.mypy.overrides]]
module = [
"gi",
"gi.repository",
"junitxml",
"testscenarios",
]
ignore_missing_imports = true

[project]
authors = [
{ name = "Robert Collins", email = "subunit-dev@lists.launchpad.net" },
Expand Down
6 changes: 0 additions & 6 deletions python/subunit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,6 @@ def test_script_two(self):
PROGRESS_POP = 3


def test_suite():
import subunit.tests

return subunit.tests.test_suite()


def join_dir(base_path, path):
"""
Returns an absolute path to C{path}, calculated relative to the parent
Expand Down
2 changes: 1 addition & 1 deletion python/subunit/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
EPOCH = datetime.datetime.fromtimestamp(0, tz=iso8601.UTC)
NUL_ELEMENT = b"\0"[0]
# Contains True for types for which 'nul in thing' falsely returns false.
_nul_test_broken = {}
_nul_test_broken: dict[type, bool] = {}


def read_exactly(stream, size):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
_remote_exception_str_chunked = "57\r\n" + _remote_exception_str + ": boo qux\n0\r\n"


from subunit.tests import ( # noqa: E402
from . import ( # noqa: E402
test_chunked,
test_details,
test_filter_to_disk,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
if len(sys.argv) == 2:
# subunit.tests.test_test_protocol.TestExecTestCase.test_sample_method_args
# tests.test_test_protocol.TestExecTestCase.test_sample_method_args
# uses this code path to be sure that the arguments were passed to
# sample-script.py
print("test fail")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions python/subunit/tests/test_run.py → python/tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_exits_zero_when_tests_fail(self):
try:
self.assertEqual(
None,
run.main(argv=["progName", "subunit.tests.test_run.TestSubunitTestRunner.FailingTest"], stdout=stream),
run.main(argv=["progName", "tests.test_run.TestSubunitTestRunner.FailingTest"], stdout=stream),
)
except SystemExit:
self.fail("SystemExit raised")
Expand All @@ -109,7 +109,7 @@ def test_exits_nonzero_when_execution_errors(self):
exc = self.assertRaises(
SystemExit,
run.main,
argv=["progName", "subunit.tests.test_run.TestSubunitTestRunner.ExitingTest"],
argv=["progName", "tests.test_run.TestSubunitTestRunner.ExitingTest"],
stdout=stream,
)
self.assertEqual(0, exc.args[0])
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import iso8601

import subunit
from subunit.tests import (
from . import (
_remote_exception_repr,
_remote_exception_repr_chunked,
_remote_exception_str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

import datetime
from io import BytesIO
from typing import Callable, Optional
from types import ModuleType

try:
from hypothesis import given
Expand All @@ -25,17 +27,17 @@
# Settings.default.verbosity = Verbosity.verbose
import hypothesis.strategies as st
except ImportError:
given = None
st = None
given: Optional[Callable[..., Callable[..., None]]] = None # type: ignore[assignment,no-redef]
st: Optional[ModuleType] = None # type: ignore[assignment,no-redef]
from testtools import TestCase
from testtools.matchers import Contains, HasLength
from testtools.testresult.doubles import StreamResult

try:
from testtools.tests.test_testresult import TestStreamResultContract
from testtools.tests.test_testresult import TestStreamResultContract # type: ignore[import-not-found]
except ImportError:
# testtools >= 2.8 no longer includes the tests submodule
TestStreamResultContract = None
TestStreamResultContract: Optional[type] = None # type: ignore[assignment,misc,no-redef]

import subunit
import iso8601
Expand Down