We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db3e990 commit de93be5Copy full SHA for de93be5
1 file changed
Lib/unittest/loader.py
@@ -356,7 +356,10 @@ def _get_name_from_path(self, path):
356
return '.'
357
path = _splitext(os.path.normpath(path))
358
359
- _relpath = os.path.relpath(path, self._top_level_dir)
+ path_real = os.path.realpath(path)
360
+ tld_real = os.path.realpath(self._top_level_dir)
361
+ _relpath = os.path.relpath(path_real, tld_real)
362
+
363
assert not os.path.isabs(_relpath), "Path must be within the project"
364
assert not _relpath.startswith('..'), "Path must be within the project"
365
0 commit comments