-
-
Notifications
You must be signed in to change notification settings - Fork 18.9k
CI: Fix scripts tests when running from another directory #62181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -10,7 +10,7 @@ class TestStringsWithWrongPlacedWhitespace: | |||
"data", | |||
[ | |||
( | |||
""" | |||
r""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed that without having this as a raw string, the test will fail on Python 3.12.
@@ -10,34 +10,36 @@ | |||
pin_min_versions_to_yaml_file, | |||
) | |||
|
|||
BASE_PATH = pathlib.Path(__file__).parents[2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be more robust to define pathlib.Path("scripts/tests/data/").resolve()
that can be used for the test below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made an update here to use DATA_PATH
with scripts/test/data
appended. But we don't want to use pathlib.Path("scripts/tests/data/")
as that would only be correct if you're running the test from the root directory of the repo.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.scripts/
tests fail when you don't run from the root directory of the repository.