From 44d74a9af58956162aef50022942b876f3423d6d 2021-10-23 12:01:15 From: Samuel Gaist Date: 2021-10-23 12:01:15 Subject: [PATCH] [core][tests][completerlib] Remove nose --- diff --git a/IPython/core/tests/test_completerlib.py b/IPython/core/tests/test_completerlib.py index f87e784..b550844 100644 --- a/IPython/core/tests/test_completerlib.py +++ b/IPython/core/tests/test_completerlib.py @@ -14,8 +14,6 @@ import tempfile import unittest from os.path import join -import nose.tools as nt - from IPython.core.completerlib import magic_run_completer, module_completion, try_import from IPython.utils.tempdir import TemporaryDirectory from IPython.testing.decorators import onlyif_unicode_paths @@ -140,7 +138,7 @@ def test_import_invalid_module(): s = set( module_completion('import foo') ) intersection = s.intersection(invalid_module_names) - nt.assert_equal(intersection, set()) + assert intersection == set() assert valid_module_names.issubset(s), valid_module_names.intersection(s) @@ -153,15 +151,15 @@ def test_bad_module_all(): testsdir = os.path.dirname(__file__) sys.path.insert(0, testsdir) try: - results = module_completion('from bad_all import ') - nt.assert_in('puppies', results) + results = module_completion("from bad_all import ") + assert "puppies" in results for r in results: - nt.assert_is_instance(r, str) + assert isinstance(r, str) # bad_all doesn't contain submodules, but this completion # should finish without raising an exception: results = module_completion("import bad_all.") - nt.assert_equal(results, []) + assert results == [] finally: sys.path.remove(testsdir) @@ -189,6 +187,6 @@ def test_valid_exported_submodules(): """ results = module_completion("import os.pa") # ensure we get a valid submodule: - nt.assert_in("os.path", results) + assert "os.path" in results # ensure we don't get objects that aren't submodules: - nt.assert_not_in("os.pathconf", results) + assert "os.pathconf" not in results