Skip to content

Commit

Permalink
test/pybind/ceph_daemon: Switch to bare unittest
Browse files Browse the repository at this point in the history
nose has been unmaintained for a long time, and to work on
removing it as a dependency, re-work test_ceph_daemon to use
bare unittest.

Signed-off-by: Steve Kowalik <steven@wedontsleep.org>
  • Loading branch information
s-t-e-v-e-n-k committed Apr 4, 2022
1 parent 9f1c094 commit 34d8fc1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/test/pybind/CMakeLists.txt
@@ -1,4 +1,4 @@
add_ceph_test(test_ceph_daemon.py
${Python3_EXECUTABLE} -m nose ${CMAKE_CURRENT_SOURCE_DIR}/test_ceph_daemon.py)
${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_ceph_daemon.py)
add_ceph_test(test_ceph_argparse.py
${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_ceph_argparse.py)
14 changes: 9 additions & 5 deletions src/test/pybind/test_ceph_daemon.py
Expand Up @@ -11,7 +11,7 @@
Foundation. See file COPYING.
"""

from unittest import TestCase
import unittest

from ceph_daemon import DaemonWatcher

Expand All @@ -21,7 +21,7 @@
from io import StringIO


class TestDaemonWatcher(TestCase):
class TestDaemonWatcher(unittest.TestCase):
def test_format(self):
dw = DaemonWatcher(None)

Expand All @@ -39,10 +39,14 @@ def test_col_width(self):
def test_supports_color(self):
dw = DaemonWatcher(None)
# Can't count on having a tty available during tests, so only test the false case
self.assertEqual(dw.supports_color(StringIO()), False)
self.assertFalse(dw.supports_color(StringIO()))


if __name__ == '__main__':
unittest.main()


# Local Variables:
# compile-command: "cd ../../..;
# PYTHONPATH=src/pybind nosetests --stop \
# src/test/pybind/test_ceph_daemon.py"
# PYTHONPATH=src/pybind python3 src/test/pybind/test_ceph_daemon.py"
# End:

0 comments on commit 34d8fc1

Please sign in to comment.