Skip to content

Commit f8d2a76

Browse files
gfyoungvictor
authored and
victor
committed
MAINT: Reset sys.path if docstrings import fails (pandas-dev#22456)
Follow-up to pandas-devgh-22413.
1 parent 1f9d0ac commit f8d2a76

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 to `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)