Skip to content

Commit

Permalink
Merge pull request #42 from mdmintz/update-line-separator-and-build-s…
Browse files Browse the repository at this point in the history
…ystem

Update line separator and build system
  • Loading branch information
mdmintz committed Sep 22, 2024
2 parents 25a7dbb + d291c5f commit 18b2dc7
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nose/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# pynose nose package
__version__ = "1.5.2"
__version__ = "1.5.3"
12 changes: 11 additions & 1 deletion nose/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {}
Expand Down
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 18b2dc7

Please sign in to comment.