diff --git a/IPython/lib/tests/test_latextools.py b/IPython/lib/tests/test_latextools.py
index fafff73..60a7589 100644
--- a/IPython/lib/tests/test_latextools.py
+++ b/IPython/lib/tests/test_latextools.py
@@ -5,7 +5,6 @@
 from contextlib import contextmanager
 from unittest.mock import patch
 
-import nose.tools as nt
 import pytest
 
 from IPython.lib import latextools
@@ -185,7 +184,13 @@ def test_latex_to_png_invalid_hex_colors():
     Test that invalid hex colors provided to dvipng gives an exception.
     """
     latex_string = "$x^2$"
-    nt.assert_raises(ValueError, lambda: latextools.latex_to_png(latex_string,
-                                        backend='dvipng', color="#f00bar"))
-    nt.assert_raises(ValueError, lambda: latextools.latex_to_png(latex_string,
-                                        backend='dvipng', color="#f00"))
+    pytest.raises(
+        ValueError,
+        lambda: latextools.latex_to_png(
+            latex_string, backend="dvipng", color="#f00bar"
+        ),
+    )
+    pytest.raises(
+        ValueError,
+        lambda: latextools.latex_to_png(latex_string, backend="dvipng", color="#f00"),
+    )