Skip to content

Conversation

@dbungert
Copy link
Member

@dbungert dbungert commented Sep 8, 2023

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
Copy link
Collaborator

@mwhudson mwhudson left a comment

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
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
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
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.

Copy link
Collaborator

@mwhudson mwhudson left a comment

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