Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 FORMAT_DATE_MAP to "yyyy mm dd" which contains whitespaces.
config(FORMAT_DATE_MAP="yyyy mm dd")
Comment on lines +80 to +81
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a test being added to use this whitespace-containing FORMAT_DATE_MAP or is this sufficient to be used on other tests to make sure that whitespace can work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this sufficient to be used on other tests to make sure that whitespace can work?

Yes, please see #2298 (comment)

with config(FORMAT_DATE_MAP="o dd"):
fig.basemap(
region=["1969-7-21T", "1969-7-23T", 0, 1],
Expand Down