diff --git a/IPython/extensions/tests/test_storemagic.py b/IPython/extensions/tests/test_storemagic.py index acf1abf..3ac306b 100644 --- a/IPython/extensions/tests/test_storemagic.py +++ b/IPython/extensions/tests/test_storemagic.py @@ -1,4 +1,5 @@ import tempfile, os +from pathlib import Path from traitlets.config.loader import Config @@ -43,7 +44,7 @@ def test_store_restore(): assert ip.user_ns["foobaz"] == "80" ip.magic("store -r") # restores _dh too - assert os.path.realpath(tmpd) in ip.user_ns["_dh"] + assert any(Path(tmpd).samefile(p) for p in ip.user_ns["_dh"]) os.rmdir(tmpd) diff --git a/IPython/utils/tests/test_tempdir.py b/IPython/utils/tests/test_tempdir.py index 68a3e03..9191b97 100644 --- a/IPython/utils/tests/test_tempdir.py +++ b/IPython/utils/tests/test_tempdir.py @@ -22,8 +22,8 @@ def test_named_file_in_temporary_directory(): def test_temporary_working_directory(): with TemporaryWorkingDirectory() as directory: - directory_path = Path(directory) + directory_path = Path(directory).resolve() assert directory_path.exists() - assert Path.cwd() == directory_path.resolve() + assert Path.cwd().resolve() == directory_path assert not directory_path.exists() - assert Path.cwd() != directory_path.resolve() + assert Path.cwd().resolve() != directory_path