diff --git a/IPython/lib/tests/test_display.py b/IPython/lib/tests/test_display.py index e78870a..160c6a1 100644 --- a/IPython/lib/tests/test_display.py +++ b/IPython/lib/tests/test_display.py @@ -14,6 +14,11 @@ #----------------------------------------------------------------------------- from tempfile import NamedTemporaryFile, mkdtemp from os.path import split, join as pjoin, dirname +import sys +try: + import pathlib +except ImportError: + pass # Third-party imports import nose.tools as nt @@ -33,6 +38,9 @@ from IPython.testing.decorators import skipif_not_numpy def test_instantiation_FileLink(): """FileLink: Test class can be instantiated""" fl = display.FileLink('example.txt') + # TODO: remove if when only Python >= 3.6 is supported + if sys.version_info >= (3, 6): + fl = display.FileLink(pathlib.PurePath('example.txt')) def test_warning_on_non_existant_path_FileLink(): """FileLink: Calling _repr_html_ on non-existant files returns a warning