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.
Please note that the same code is also defined in test_clib.py.
There was a problem hiding this comment.
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.
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.
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?
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Description of proposed changes
Address #2729 (comment).
Reminders
make formatandmake checkto 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