Skip to content
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

Test test_gmt_compat_6_is_applied leaves a gmt.conf file in the current directory #453

Closed
seisman opened this issue May 24, 2020 · 0 comments · Fixed by #454
Closed

Test test_gmt_compat_6_is_applied leaves a gmt.conf file in the current directory #453

seisman opened this issue May 24, 2020 · 0 comments · Fixed by #454
Assignees
Labels
bug Something isn't working maintenance Boring but important stuff for the core devs

Comments

@seisman
Copy link
Member

seisman commented May 24, 2020

Description of the problem

To reproduce the bug, run:

mkdir tmp-test-dir-with-unique-name
cd tmp-test-dir-with-unique-name
pytest ../pygmt/tests/test_session_management.py

then you'll see a "gmt.conf" file in the tmp-test-dir-with-unique-name directory.

The "gmt.conf" file is generated by the test "test_gmt_compat_6_is_applied":

end() # Kill the global session
try:
with Session() as lib:
# pretend that gmt.conf has GMT_COMPATIBILITY = 5
lib.call_module("gmtset", "GMT_COMPATIBILITY 5")

At the end of the test, Lines 46-49 revert the GMT_COMPATIBILTY to 6. However, these codes only affect the gmt.conf in the session directory. The "gmt.conf" in the current directory is still untouched, with GMT_COMPATIBILITY set to 5.

finally:
with Session() as lib:
# revert gmt.conf back to GMT_COMPATIBILITY = 6
lib.call_module("set", "GMT_COMPATIBILITY 6")
end()

We should remove the "gmt.conf" from the current directory at the end of the test.

@seisman seisman self-assigned this May 24, 2020
@seisman seisman added bug Something isn't working maintenance Boring but important stuff for the core devs labels May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant