Skip to content

Commit f0b0f38

Browse files
committed
MAINT: Reset sys.path if docstrings import fails
Follow-up to gh-22413.
1 parent 68273a7 commit f0b0f38

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/tests/scripts/test_validate_docstrings.py

+3
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,9 @@ def import_scripts(self):
471471
from validate_docstrings import validate_one
472472
globals()[global_validate_one] = validate_one
473473
except ImportError:
474+
# Remove addition `sys.path`
475+
sys.path.pop()
476+
474477
# Import will fail if the pandas installation is not inplace.
475478
raise pytest.skip("pandas/scripts directory does not exist")
476479

0 commit comments

Comments
 (0)