diff --git a/nose/__version__.py b/nose/__version__.py index c5a968a..70579f3 100755 --- a/nose/__version__.py +++ b/nose/__version__.py @@ -1,2 +1,2 @@ # pynose nose package -__version__ = "1.5.2" +__version__ = "1.5.3" diff --git a/nose/result.py b/nose/result.py index fd6fa08..1abb77d 100644 --- a/nose/result.py +++ b/nose/result.py @@ -5,6 +5,8 @@ provide support for error classes (such as the builtin skip and deprecated classes), and hooks for plugins to take over or extend reporting.""" import logging +import os +from contextlib import suppress from unittest import TextTestResult as _TextTestResult from nose.config import Config from nose.util import isclass, ln as _ln @@ -95,7 +97,15 @@ def printSummary(self, start, stop): taken = float(stop - start) run = self.testsRun plural = run != 1 and "s" or "" - writeln(self.separator2) + terminal_width = 40 # The default width if failure to calculate + with suppress(Exception): + terminal_width = os.get_terminal_size().columns + if not isinstance(terminal_width, int): + terminal_width = 40 + elif terminal_width < 26: + terminal_width = 26 + separator = "-" * terminal_width + writeln(separator[:70]) writeln("Ran %s test%s in %.3fs" % (run, plural, taken)) writeln() summary = {} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..80fa654 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ["setuptools>=68.0.0", "wheel>=0.42.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "pynose" +readme = "README.md" +dynamic = [ + "urls", + "version", + "license", + "authors", + "scripts", + "keywords", + "classifiers", + "description", + "entry-points", + "dependencies", + "requires-python", + "optional-dependencies", +] + +[tool.setuptools] +packages = ["nose", "nose.plugins", "nose.sphinx", "nose.tools"] + +[flake8] +ignore = ["W503"] + +[nosetests] +nocapture = ["1"] +logging-level = ["INFO"]