-
Notifications
You must be signed in to change notification settings - Fork 224
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
Move virtualfile-related tests into a separate test file #2784
Conversation
|
||
|
||
@contextmanager | ||
def mock(session, func, returns=None, mock_func=None): |
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.
Please note that the same code is also defined in test_clib.py
.
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.
Hmm, the typical way of sharing fixtures in pytest would be to put them in conftest.py
, but not sure about this contextmanager... We could also just keep that single test_virtual_file_fails
test in test_clib.py
to avoid duplicating this contextmanager?
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.
I just realized the mock
function is also used in other files like test_clib_put_matrix.py
by from pygmt.tests.test_clib import mock
.
This may not be a best practice but it works. Done in d5ef26e.
|
||
|
||
@contextmanager | ||
def mock(session, func, returns=None, mock_func=None): |
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.
Hmm, the typical way of sharing fixtures in pytest would be to put them in conftest.py
, but not sure about this contextmanager... We could also just keep that single test_virtual_file_fails
test in test_clib.py
to avoid duplicating this contextmanager?
Description of proposed changes
Address #2729 (comment).
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version