File: import-pytest.patch

package info (click to toggle)
python-xarray 2025.08.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,796 kB
  • sloc: python: 115,416; makefile: 258; sh: 47
file content (46 lines) | stat: -rw-r--r-- 1,597 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Description: Make suitable for execution under pytest
  Gets discovered automatically by pytest, so fix up import
  and markups
Author: Alastair McKinstry <mckinstry@debian.org>
Last-Updated: 2025-03-26
Forwarded: no

--- a/xarray/tests/test_tutorial.py
+++ b/xarray/tests/test_tutorial.py
@@ -3,18 +3,19 @@
 from xarray import DataArray, DataTree, tutorial
 from xarray.testing import assert_identical
 from xarray.tests import network
+import pytest
 
 
 @network
 class TestLoadDataset:
-    @pytest.mark_xfail
+    @pytest.mark.xfail
     def test_download_from_github(self, tmp_path) -> None:
         cache_dir = tmp_path / tutorial._default_cache_dir_name
         ds = tutorial.open_dataset("tiny", cache_dir=cache_dir).load()
         tiny = DataArray(range(5), name="tiny").to_dataset()
         assert_identical(ds, tiny)
 
-    @pytest.mark_xfail
+    @pytest.mark.xfail
     def test_download_from_github_load_without_cache(
         self, tmp_path, monkeypatch
     ) -> None:
@@ -29,12 +30,14 @@
 
 @network
 class TestLoadDataTree:
+    @pytest.mark.skip("Skipping due to download needed")
     def test_download_from_github(self, tmp_path) -> None:
         cache_dir = tmp_path / tutorial._default_cache_dir_name
         ds = tutorial.open_datatree("tiny", cache_dir=cache_dir).load()
         tiny = DataTree.from_dict({"/": DataArray(range(5), name="tiny").to_dataset()})
         assert_identical(ds, tiny)
 
+    @pytest.mark.skip("Skipping due to download needed")
     def test_download_from_github_load_without_cache(
         self, tmp_path, monkeypatch
     ) -> None: