File: cftime_xfail.patch

package info (click to toggle)
python-xarray 0.11.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,476 kB
  • sloc: python: 37,552; makefile: 231; sh: 1
file content (29 lines) | stat: -rw-r--r-- 1,216 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Description: XFAIL due to error in cftime 1.0.2
 With cftime 1.0.2, we get the following error when we use Python3:
 "TypeError: Cannot cast datetime.timedelta object from metadata [Y] to [us] according to the rule 'same_kind'"
 So mark the affected tests XFAIL until fixed.
Bug-Origin: https://bug.debian.org/913524
Last-Updated: 2018-11-12
Forwarded: no

Index: python-xarray-0.11.1/xarray/tests/test_coding_times.py
===================================================================
--- python-xarray-0.11.1.orig/xarray/tests/test_coding_times.py
+++ python-xarray-0.11.1/xarray/tests/test_coding_times.py
@@ -3,6 +3,7 @@ from __future__ import absolute_import,
 import warnings
 from itertools import product
 
+import sys
 import numpy as np
 import pandas as pd
 import pytest
@@ -71,6 +72,8 @@ def _all_cftime_date_types():
             'proleptic_gregorian': cftime.DatetimeProlepticGregorian}
 
 
+@pytest.mark.xfail(sys.version_info.major == 3,
+                  reason='cftime bug (in 1.0.2): fails to cast astype')
 @pytest.mark.skipif(not has_cftime_or_netCDF4, reason='cftime not installed')
 @pytest.mark.parametrize(['num_dates', 'units', 'calendar'],
                          _CF_DATETIME_TESTS)