From 81d78836ba5e0f38746eae23ba4bb29a577dd4ab Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Fri, 23 Apr 2021 10:53:55 +1200 Subject: [PATCH 1/2] Remove xfails on pygmt.info tests with a time column Upstream bug resolved with GMT 6.2.0rc1 so the expected failure (xfail) decorators can be removed now. --- pygmt/tests/test_info.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pygmt/tests/test_info.py b/pygmt/tests/test_info.py index ab1093b29d2..3d6da9455ed 100644 --- a/pygmt/tests/test_info.py +++ b/pygmt/tests/test_info.py @@ -64,10 +64,6 @@ def test_info_numpy_array_time_column(): assert output == expected_output -@pytest.mark.xfail( - reason="UNIX timestamps returned instead of ISO datetime, should work on GMT 6.2.0 " - "after https://github.com/GenericMappingTools/gmt/issues/4241 is resolved", -) def test_info_pandas_dataframe_time_column(): """ Make sure info works on pandas.DataFrame inputs with a time column. @@ -85,10 +81,6 @@ def test_info_pandas_dataframe_time_column(): assert output == expected_output -@pytest.mark.xfail( - reason="UNIX timestamp returned instead of ISO datetime, should work on GMT 6.2.0 " - "after https://github.com/GenericMappingTools/gmt/issues/4241 is resolved", -) def test_info_xarray_dataset_time_column(): """ Make sure info works on xarray.Dataset 1D inputs with a time column. From 3b360d95b4b2631e239a1ae6ddc0b77ed62ddc98 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Fri, 23 Apr 2021 10:55:17 +1200 Subject: [PATCH 2/2] Remove coltypes="0T" workaround since datetime inputs to info is ok now --- pygmt/tests/test_info.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pygmt/tests/test_info.py b/pygmt/tests/test_info.py index 3d6da9455ed..b3a0b4ae78b 100644 --- a/pygmt/tests/test_info.py +++ b/pygmt/tests/test_info.py @@ -55,9 +55,7 @@ def test_info_numpy_array_time_column(): Make sure info works on a numpy.ndarray input with a datetime type. """ table = pd.date_range(start="2020-01-01", periods=5).to_numpy() - # Please remove coltypes="0T" workaround after - # https://github.com/GenericMappingTools/gmt/issues/4241 is resolved - output = info(table=table, coltypes="0T") + output = info(table=table) expected_output = ( ": N = 5 <2020-01-01T00:00:00/2020-01-05T00:00:00>\n" ) @@ -135,9 +133,7 @@ def test_info_per_column_with_time_inputs(): Make sure the per_column option works with time inputs. """ table = pd.date_range(start="2020-01-01", periods=5).to_numpy() - # Please remove coltypes="0T" workaround after - # https://github.com/GenericMappingTools/gmt/issues/4241 is resolved - output = info(table=table, per_column=True, coltypes="0T") + output = info(table=table, per_column=True) npt.assert_equal( actual=output, desired=["2020-01-01T00:00:00", "2020-01-05T00:00:00"] )