13
13
df = rawDf .to_dict ("records" )
14
14
15
15
16
- def get_app ():
16
+ def get_app (props = dict () ):
17
17
app = dash .Dash (__name__ )
18
18
19
- app . layout = DataTable (
19
+ baseProps = dict (
20
20
id = "table" ,
21
21
columns = [{"name" : i , "id" : i } for i in rawDf .columns ],
22
22
data = df ,
@@ -30,11 +30,18 @@ def get_app():
30
30
sort_action = "native" ,
31
31
)
32
32
33
+ baseProps .update (props )
34
+
35
+ app .layout = DataTable (** baseProps )
36
+
33
37
return app
34
38
35
39
36
- def test_tbst001_get_cell (test ):
37
- test .start_server (get_app ())
40
+ @pytest .mark .parametrize (
41
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
42
+ )
43
+ def test_tbst001_get_cell (test , props ):
44
+ test .start_server (get_app (props ))
38
45
39
46
target = test .table ("table" )
40
47
@@ -44,8 +51,11 @@ def test_tbst001_get_cell(test):
44
51
assert test .get_log_errors () == []
45
52
46
53
47
- def test_tbst002_select_all_text (test ):
48
- test .start_server (get_app ())
54
+ @pytest .mark .parametrize (
55
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
56
+ )
57
+ def test_tbst002_select_all_text (test , props ):
58
+ test .start_server (get_app (props ))
49
59
50
60
target = test .table ("table" )
51
61
@@ -150,8 +160,11 @@ def test_tbst009_active_focused_arrow_down(test):
150
160
assert test .get_log_errors () == []
151
161
152
162
153
- def test_tbst010_active_with_dblclick (test ):
154
- test .start_server (get_app ())
163
+ @pytest .mark .parametrize (
164
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
165
+ )
166
+ def test_tbst010_active_with_dblclick (test , props ):
167
+ test .start_server (get_app (props ))
155
168
156
169
target = test .table ("table" )
157
170
@@ -161,8 +174,11 @@ def test_tbst010_active_with_dblclick(test):
161
174
assert test .get_log_errors () == []
162
175
163
176
164
- def test_tbst011_delete_row (test ):
165
- test .start_server (get_app ())
177
+ @pytest .mark .parametrize (
178
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
179
+ )
180
+ def test_tbst011_delete_row (test , props ):
181
+ test .start_server (get_app (props ))
166
182
167
183
target = test .table ("table" )
168
184
@@ -173,8 +189,11 @@ def test_tbst011_delete_row(test):
173
189
assert test .get_log_errors () == []
174
190
175
191
176
- def test_tbst012_delete_sorted_row (test ):
177
- test .start_server (get_app ())
192
+ @pytest .mark .parametrize (
193
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
194
+ )
195
+ def test_tbst012_delete_sorted_row (test , props ):
196
+ test .start_server (get_app (props ))
178
197
179
198
target = test .table ("table" )
180
199
@@ -188,8 +207,16 @@ def test_tbst012_delete_sorted_row(test):
188
207
assert test .get_log_errors () == []
189
208
190
209
191
- def test_tbst013_select_row (test ):
192
- test .start_server (get_app ())
210
+ @pytest .mark .parametrize (
211
+ "props" ,
212
+ [
213
+ dict (virtualization = False ),
214
+ dict (virtualization = True ),
215
+ dict (editable = False , row_deletable = False ),
216
+ ],
217
+ )
218
+ def test_tbst013_select_row (test , props ):
219
+ test .start_server (get_app (props ))
193
220
194
221
target = test .table ("table" )
195
222
@@ -199,8 +226,16 @@ def test_tbst013_select_row(test):
199
226
assert test .get_log_errors () == []
200
227
201
228
202
- def test_tbst014_selected_sorted_row (test ):
203
- test .start_server (get_app ())
229
+ @pytest .mark .parametrize (
230
+ "props" ,
231
+ [
232
+ dict (virtualization = False ),
233
+ dict (virtualization = True ),
234
+ dict (editable = False , row_deletable = False ),
235
+ ],
236
+ )
237
+ def test_tbst014_selected_sorted_row (test , props ):
238
+ test .start_server (get_app (props ))
204
239
205
240
target = test .table ("table" )
206
241
@@ -212,8 +247,16 @@ def test_tbst014_selected_sorted_row(test):
212
247
assert test .get_log_errors () == []
213
248
214
249
215
- def test_tbst015_selected_row_respects_sort (test ):
216
- test .start_server (get_app ())
250
+ @pytest .mark .parametrize (
251
+ "props" ,
252
+ [
253
+ dict (virtualization = False ),
254
+ dict (virtualization = True ),
255
+ dict (editable = False , row_deletable = False ),
256
+ ],
257
+ )
258
+ def test_tbst015_selected_row_respects_sort (test , props ):
259
+ test .start_server (get_app (props ))
217
260
218
261
target = test .table ("table" )
219
262
@@ -232,8 +275,11 @@ def test_tbst015_selected_row_respects_sort(test):
232
275
assert test .get_log_errors () == []
233
276
234
277
235
- def test_tbst016_delete_cell (test ):
236
- test .start_server (get_app ())
278
+ @pytest .mark .parametrize (
279
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
280
+ )
281
+ def test_tbst016_delete_cell (test , props ):
282
+ test .start_server (get_app (props ))
237
283
238
284
target = test .table ("table" )
239
285
@@ -246,8 +292,11 @@ def test_tbst016_delete_cell(test):
246
292
247
293
248
294
@pytest .mark .skip (reason = "https://github.com/plotly/dash-table/issues/700" )
249
- def test_tbst017_delete_cell_updates_while_selected (test ):
250
- test .start_server (get_app ())
295
+ @pytest .mark .parametrize (
296
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
297
+ )
298
+ def test_tbst017_delete_cell_updates_while_selected (test , props ):
299
+ test .start_server (get_app (props ))
251
300
252
301
target = test .table ("table" )
253
302
@@ -258,8 +307,11 @@ def test_tbst017_delete_cell_updates_while_selected(test):
258
307
assert test .get_log_errors () == []
259
308
260
309
261
- def test_tbst018_delete_multiple_cells (test ):
262
- test .start_server (get_app ())
310
+ @pytest .mark .parametrize (
311
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
312
+ )
313
+ def test_tbst018_delete_multiple_cells (test , props ):
314
+ test .start_server (get_app (props ))
263
315
264
316
target = test .table ("table" )
265
317
@@ -277,8 +329,11 @@ def test_tbst018_delete_multiple_cells(test):
277
329
278
330
279
331
@pytest .mark .skip (reason = "https://github.com/plotly/dash-table/issues/700" )
280
- def test_tbst019_delete_multiple_cells_while_selected (test ):
281
- test .start_server (get_app ())
332
+ @pytest .mark .parametrize (
333
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
334
+ )
335
+ def test_tbst019_delete_multiple_cells_while_selected (test , props ):
336
+ test .start_server (get_app (props ))
282
337
283
338
target = test .table ("table" )
284
339
@@ -295,8 +350,11 @@ def test_tbst019_delete_multiple_cells_while_selected(test):
295
350
assert test .get_log_errors () == []
296
351
297
352
298
- def test_tbst020_sorted_table_delete_cell (test ):
299
- test .start_server (get_app ())
353
+ @pytest .mark .parametrize (
354
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
355
+ )
356
+ def test_tbst020_sorted_table_delete_cell (test , props ):
357
+ test .start_server (get_app (props ))
300
358
301
359
target = test .table ("table" )
302
360
@@ -312,8 +370,11 @@ def test_tbst020_sorted_table_delete_cell(test):
312
370
313
371
314
372
@pytest .mark .skip (reason = "https://github.com/plotly/dash-table/issues/700" )
315
- def test_tbst021_sorted_table_delete_cell_updates_while_selected (test ):
316
- test .start_server (get_app ())
373
+ @pytest .mark .parametrize (
374
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
375
+ )
376
+ def test_tbst021_sorted_table_delete_cell_updates_while_selected (test , props ):
377
+ test .start_server (get_app (props ))
317
378
318
379
target = test .table ("table" )
319
380
@@ -327,8 +388,11 @@ def test_tbst021_sorted_table_delete_cell_updates_while_selected(test):
327
388
assert test .get_log_errors () == []
328
389
329
390
330
- def test_tbst022_sorted_table_delete_multiple_cells (test ):
331
- test .start_server (get_app ())
391
+ @pytest .mark .parametrize (
392
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
393
+ )
394
+ def test_tbst022_sorted_table_delete_multiple_cells (test , props ):
395
+ test .start_server (get_app (props ))
332
396
333
397
target = test .table ("table" )
334
398
@@ -349,8 +413,11 @@ def test_tbst022_sorted_table_delete_multiple_cells(test):
349
413
350
414
351
415
@pytest .mark .skip (reason = "https://github.com/plotly/dash-table/issues/700" )
352
- def test_tbst023_sorted_table_delete_multiple_cells_while_selected (test ):
353
- test .start_server (get_app ())
416
+ @pytest .mark .parametrize (
417
+ "props" , [dict (virtualization = False ), dict (virtualization = True )]
418
+ )
419
+ def test_tbst023_sorted_table_delete_multiple_cells_while_selected (test , props ):
420
+ test .start_server (get_app (props ))
354
421
355
422
target = test .table ("table" )
356
423
0 commit comments