From f03bb32540a6ed0180cb5406de64c0e57b988350 2021-08-18 23:48:23 From: Matthias Bussonnier Date: 2021-08-18 23:48:23 Subject: [PATCH] remove nose from test_background_jobs --- diff --git a/IPython/lib/tests/test_backgroundjobs.py b/IPython/lib/tests/test_backgroundjobs.py index d7793f5..fc76ff1 100644 --- a/IPython/lib/tests/test_backgroundjobs.py +++ b/IPython/lib/tests/test_backgroundjobs.py @@ -15,9 +15,6 @@ # Stdlib imports import time -# Third-party imports -import nose.tools as nt - # Our own imports from IPython.lib import backgroundjobs as bg @@ -49,18 +46,18 @@ def test_result(): jobs = bg.BackgroundJobManager() j = jobs.new(sleeper) j.join() - nt.assert_equal(j.result['interval'], t_short) - + assert j.result["interval"] == t_short + def test_flush(): """Test job control""" jobs = bg.BackgroundJobManager() j = jobs.new(sleeper) j.join() - nt.assert_equal(len(jobs.completed), 1) - nt.assert_equal(len(jobs.dead), 0) + assert len(jobs.completed) == 1 + assert len(jobs.dead) == 0 jobs.flush() - nt.assert_equal(len(jobs.completed), 0) + assert len(jobs.completed) == 0 def test_dead(): @@ -68,10 +65,10 @@ def test_dead(): jobs = bg.BackgroundJobManager() j = jobs.new(crasher) j.join() - nt.assert_equal(len(jobs.completed), 0) - nt.assert_equal(len(jobs.dead), 1) + assert len(jobs.completed) == 0 + assert len(jobs.dead) == 1 jobs.flush() - nt.assert_equal(len(jobs.dead), 0) + assert len(jobs.dead) == 0 def test_longer(): @@ -81,8 +78,8 @@ def test_longer(): # job as running, but not so long that it makes the test suite noticeably # slower. j = jobs.new(sleeper, 0.1) - nt.assert_equal(len(jobs.running), 1) - nt.assert_equal(len(jobs.completed), 0) + assert len(jobs.running) == 1 + assert len(jobs.completed) == 0 j.join() - nt.assert_equal(len(jobs.running), 0) - nt.assert_equal(len(jobs.completed), 1) + assert len(jobs.running) == 0 + assert len(jobs.completed) == 1