@@ -107,35 +107,3 @@ def test_open_virtualfile_bad_direction():
107
107
with pytest .raises (GMTInvalidInput ):
108
108
with lib .open_virtualfile (* vfargs ):
109
109
pass
110
-
111
-
112
- # TODO(PyGMT>=0.15.0): Remove the test after removing the deprecated open_virtual_file
113
- # method.
114
- def test_open_virtual_file ():
115
- """
116
- Test the deprecated Session.open_virtual_file method.
117
-
118
- This test is the same as test_open_virtualfile, but using the deprecated method.
119
- """
120
- shape = (5 , 3 )
121
- with clib .Session () as lib :
122
- family = "GMT_IS_DATASET|GMT_VIA_MATRIX"
123
- geometry = "GMT_IS_POINT"
124
- dataset = lib .create_data (
125
- family = family ,
126
- geometry = geometry ,
127
- mode = "GMT_CONTAINER_ONLY" ,
128
- dim = [shape [1 ], shape [0 ], 1 , 0 ], # columns, rows, layers, dtype
129
- )
130
- data = np .arange (shape [0 ] * shape [1 ]).reshape (shape )
131
- lib .put_matrix (dataset , matrix = data )
132
- # Add the dataset to a virtual file and pass it along to gmt info
133
- with pytest .warns (FutureWarning , match = "open_virtual_file" ):
134
- vfargs = (family , geometry , "GMT_IN|GMT_IS_REFERENCE" , dataset )
135
- with lib .open_virtual_file (* vfargs ) as vfile :
136
- with GMTTempFile () as outfile :
137
- lib .call_module ("info" , [vfile , f"->{ outfile .name } " ])
138
- output = outfile .read (keep_tabs = True )
139
- bounds = "\t " .join ([f"<{ col .min ():.0f} /{ col .max ():.0f} >" for col in data .T ])
140
- expected = f"<matrix memory>: N = { shape [0 ]} \t { bounds } \n "
141
- assert output == expected
0 commit comments