Skip to content

Fix tests fstools#138

Open
dbungert wants to merge 3 commits into
canonical:mainfrom
dbungert:fix-tests-fstools
Open

Fix tests fstools#138
dbungert wants to merge 3 commits into
canonical:mainfrom
dbungert:fix-tests-fstools

Conversation

@dbungert

@dbungert dbungert commented Sep 8, 2023

Copy link
Copy Markdown
Member

The probert unit tests may fail, depending on if filesystem tools are installed on the host system. We don't actually run them, that's already mocked out. Mock out the check for them existing.

These tests would only pass if the relevant tools were actually
installed, but we're not running them.
@dbungert dbungert requested a review from ogayot September 8, 2023 20:27

@mwhudson mwhudson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL @patch works on classes.

This is fine I guess. Did you consider a "ProbertTestCase" that does this mocking in setUp()?

@dbungert

Copy link
Copy Markdown
Member Author

Did you consider a "ProbertTestCase" that does this mocking in setUp()?

I've pushed a sample commit with that, I think in this case it's not ideal as the name to patch is different for filesystem vs os. If I'm missing something let me know.

@mwhudson

Copy link
Copy Markdown
Collaborator

Did you consider a "ProbertTestCase" that does this mocking in setUp()?

I've pushed a sample commit with that, I think in this case it's not ideal as the name to patch is different for filesystem vs os. If I'm missing something let me know.

Hm that's true (and it looks like you're patching the wrong path in test_os now?). Can we just patch the shutil module direclty instead though?

@dbungert

Copy link
Copy Markdown
Member Author

I pushed another version, I'm kind of ambivalent about the result though. I think in some cases this would be net beneficial but less so this one.

@mwhudson mwhudson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think this is OK, but well. Do what you like :-)

@ogayot ogayot changed the base branch from master to main May 16, 2025 08:24
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.

3 participants