Skip to content

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

@seisman

Description

@seisman

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingmaintenanceBoring but important stuff for the core devs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions