Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pygmt/src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def __enter__(self):
def __exit__(self, exc_type, exc_value, traceback):
# revert to initial values
arg_str = " ".join(
[f"{key}={value}" for key, value in self.old_defaults.items()]
[f'{key}="{value}"' for key, value in self.old_defaults.items()]
)
with Session() as lib:
lib.call_module(module="set", args=arg_str)
5 changes: 5 additions & 0 deletions pygmt/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ def test_config_format_date_map():

Note the space in 'o dd', this acts as a regression test for
https://github.com/GenericMappingTools/pygmt/issues/247.

Setting FORMAT_DATE_MAP="yyyy mm dd" as a regression test for
https://github.com/GenericMappingTools/pygmt/issues/2298.
"""
fig = Figure()
# Set the FORMAT_DATE_MAP to "yyyy mm dd" that contains whitespaces.
config(FORMAT_DATE_MAP="yyyy mm dd")
with config(FORMAT_DATE_MAP="o dd"):
fig.basemap(
region=["1969-7-21T", "1969-7-23T", 0, 1],
Expand Down