-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Mock clipboard IO #22715
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
TST: Mock clipboard IO #22715
Conversation
This failed. Unless anyone objects, I'm going to just mock the actual clipboard layer part of things. |
yeah the clipboard tests are annoying |
Hello @TomAugspurger! Thanks for updating the PR.
Comment last updated on September 16, 2018 at 11:57 Hours UTC |
OK, I think we're still testing things, but would appreciate a close look at the mocks. Basic idea is to replace Unfortunately, we had some tests in |
pandas/tests/io/test_clipboard.py
Outdated
@@ -76,10 +76,41 @@ def df(request): | |||
raise ValueError | |||
|
|||
|
|||
# our local clipboard for tests | |||
_mock_data = {} |
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.
it’s really odd to keep state outside of this fixture when it’s a function level
why don’t u just make it a module level?
or it seems that function level might be ok with state inside
pandas/tests/io/test_clipboard.py
Outdated
@pytest.fixture | ||
def mock_clipboard(mock, request): | ||
def _mock_set(data): | ||
_mock_data[request.node.name] = data |
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.
can u add a docstring
pandas/tests/io/test_clipboard.py
Outdated
class TestClipboard(object): | ||
|
||
@pytest.mark.clipboard | ||
def test_mock_clipboard(self): |
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.
can’t u use monkey patch here?
Moved the mock clipboard to be function-scope, rather than global. |
sure |
* Attempt to fix clipboard tests * note * update * update * doc
* Attempt to fix clipboard tests * note * update * update * doc
No idea if this will work on not.