]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-109959: Log the current directory in test_glob.test_selflink() (#128122)
authorVictor Stinner <vstinner@python.org>
Fri, 20 Dec 2024 12:37:20 +0000 (13:37 +0100)
committerGitHub <noreply@github.com>
Fri, 20 Dec 2024 12:37:20 +0000 (13:37 +0100)
Lib/test/test_glob.py

index b72640bd871ba6562c754cdc14a50f4cdbd3047b..00187a3fb3537d4896f9da2cbb76bd413774fd89 100644 (file)
@@ -6,6 +6,7 @@ import sys
 import unittest
 import warnings
 
+from test import support
 from test.support import is_wasi, Py_DEBUG
 from test.support.os_helper import (TESTFN, skip_unless_symlink,
                                     can_symlink, create_empty_file, change_cwd)
@@ -515,6 +516,12 @@ class SymlinkLoopGlobTests(unittest.TestCase):
         os.makedirs(tempdir)
         self.addCleanup(shutil.rmtree, tempdir)
         with change_cwd(tempdir):
+            if support.verbose:
+                cwd = os.getcwd()
+                print(f"cwd: {cwd} ({len(cwd)} chars)")
+                cwdb = os.getcwdb()
+                print(f"cwdb: {cwdb!r} ({len(cwdb)} bytes)")
+
             os.makedirs('dir')
             create_empty_file(os.path.join('dir', 'file'))
             os.symlink(os.curdir, os.path.join('dir', 'link'))