Skip to content
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

Update filesystem utilities tests to work on both Unix and Windows #10065

Closed
wants to merge 4 commits into from

Conversation

rpeden
Copy link
Contributor

@rpeden rpeden commented Jun 25, 2023

Some of the tests for prefect.utilities.filesystem:filter_files currently fail on Windows. The tests check for hardcoded Unix-style paths with forward slashes, but filter_files returns a set of paths with backslashes on Windows.

The current behavior of filter_files appears correct based on how it is used in the codebase, so this PR updates the tests to tailor the expected output of filter_files to match the platform the tests are running on.

Example

Before:

> pytest test_filesystem.py

test_filesystem.py ..FFF.FFFFF.ssss....                                                                         [100%]

===================== 8 failed, 8 passed, 4 skipped in 28.76s =====================

After:

> pytest test_filesystem.py

test_filesystem.py ............ssss....                                                                          [100%]

===================== 16 passed, 4 skipped in 28.41s =====================

Everything passes on Linux and MacOS before and after the changes in this PR.

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • I don't think this is big enough to need an issue but I can open one if needed.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. fix, feature, enhancement, docs.

For documentation changes:

  • This pull request includes redirect settings in netlify.toml for files that are removed or renamed

@netlify
Copy link

netlify bot commented Jun 25, 2023

👷 Deploy request for prefect-docs-preview pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 6938ca6

@rpeden rpeden changed the title Updated filesystem tests to work on both Unix and Windows Update filesystem tests to work on both Unix and Windows Jun 25, 2023
@rpeden rpeden mentioned this pull request Jun 25, 2023
4 tasks
@rpeden rpeden changed the title Update filesystem tests to work on both Unix and Windows Update filesystem utilities tests to work on both Unix and Windows Jun 25, 2023
@github-actions
Copy link
Contributor

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

@github-actions
Copy link
Contributor

This pull request was closed because it has been stale for 14 days with no activity. If this pull request is important or you have more to add feel free to re-open it.

@github-actions github-actions bot closed this Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant