1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
From c274b5938e868ac2e6f1f1cdb24d89a8f0399394 Mon Sep 17 00:00:00 2001
From: Jamison Lahman <jamison@lahman.dev>
Date: Thu, 28 Aug 2025 01:50:45 -0700
Subject: [PATCH] chore: replace nose with pytest
---
blessings/tests.py | 10 +++++++---
tox.ini | 4 ++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/blessings/tests.py b/blessings/tests.py
index cf19cbb2..5527fffb 100644
--- a/blessings/tests.py
+++ b/blessings/tests.py
@@ -13,8 +13,7 @@
from functools import partial
import sys
-from nose import SkipTest
-from nose.tools import eq_
+import pytest
from six import StringIO
# This tests that __all__ is correct, since we use below everything that should
@@ -25,6 +24,11 @@
TestTerminal = partial(Terminal, kind='xterm-256color')
+def eq_(a, b):
+ """Assert equality of two objects."""
+ assert a == b
+
+
def unicode_cap(cap):
"""Return the result of ``tigetstr`` except as Unicode."""
return tigetstr(cap).decode('latin1')
@@ -181,7 +185,7 @@ def test_number_of_colors_without_tty():
"""``number_of_colors`` should return 0 when there's no tty."""
# Hypothesis: once setupterm() has run and decided the tty supports 256
# colors, it never changes its mind.
- raise SkipTest
+ pytest.skip()
t = TestTerminal(stream=StringIO())
eq_(t.number_of_colors, 0)
diff --git a/tox.ini b/tox.ini
index 30464f24..f963d06a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,7 +2,7 @@
envlist = py{27,34,35,36,37,py}
[testenv]
-commands = nosetests blessings
+commands = pytest -s blessings/tests.py
deps =
- nose
+ pytest
six
|