38
38
39
39
40
40
# Create new custom topic/subscription
41
+ # We observe sometimes all the tests in this file fail. In a
42
+ # hypothesis where DLP service somehow loses the connection to the
43
+ # topic, now we use function scope for Pub/Sub fixtures.
41
44
@pytest .fixture (scope = "function" )
42
45
def topic_id ():
43
46
# Creates a pubsub topic, and tears it down.
@@ -160,7 +163,7 @@ def bigquery_project():
160
163
bigquery_client .delete_dataset (dataset_ref , delete_contents = True )
161
164
162
165
163
- @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
166
+ @pytest .mark .flaky (max_runs = 5 , min_passes = 1 )
164
167
def test_numerical_risk_analysis (
165
168
topic_id , subscription_id , bigquery_project , capsys
166
169
):
@@ -179,7 +182,7 @@ def test_numerical_risk_analysis(
179
182
assert "Value Range:" in out
180
183
181
184
182
- @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
185
+ @pytest .mark .flaky (max_runs = 5 , min_passes = 1 )
183
186
def test_categorical_risk_analysis_on_string_field (
184
187
topic_id , subscription_id , bigquery_project , capsys
185
188
):
@@ -198,7 +201,7 @@ def test_categorical_risk_analysis_on_string_field(
198
201
assert "Most common value occurs" in out
199
202
200
203
201
- @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
204
+ @pytest .mark .flaky (max_runs = 5 , min_passes = 1 )
202
205
def test_categorical_risk_analysis_on_number_field (
203
206
topic_id , subscription_id , bigquery_project , capsys
204
207
):
@@ -217,7 +220,7 @@ def test_categorical_risk_analysis_on_number_field(
217
220
assert "Most common value occurs" in out
218
221
219
222
220
- @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
223
+ @pytest .mark .flaky (max_runs = 5 , min_passes = 1 )
221
224
def test_k_anonymity_analysis_single_field (
222
225
topic_id , subscription_id , bigquery_project , capsys
223
226
):
@@ -237,7 +240,7 @@ def test_k_anonymity_analysis_single_field(
237
240
assert "Class size:" in out
238
241
239
242
240
- @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
243
+ @pytest .mark .flaky (max_runs = 5 , min_passes = 1 )
241
244
def test_k_anonymity_analysis_multiple_fields (
242
245
topic_id , subscription_id , bigquery_project , capsys
243
246
):
@@ -257,7 +260,7 @@ def test_k_anonymity_analysis_multiple_fields(
257
260
assert "Class size:" in out
258
261
259
262
260
- @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
263
+ @pytest .mark .flaky (max_runs = 5 , min_passes = 1 )
261
264
def test_l_diversity_analysis_single_field (
262
265
topic_id , subscription_id , bigquery_project , capsys
263
266
):
@@ -279,7 +282,7 @@ def test_l_diversity_analysis_single_field(
279
282
assert "Sensitive value" in out
280
283
281
284
282
- @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
285
+ @pytest .mark .flaky (max_runs = 5 , min_passes = 1 )
283
286
def test_l_diversity_analysis_multiple_field (
284
287
topic_id , subscription_id , bigquery_project , capsys
285
288
):
@@ -301,7 +304,7 @@ def test_l_diversity_analysis_multiple_field(
301
304
assert "Sensitive value" in out
302
305
303
306
304
- @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
307
+ @pytest .mark .flaky (max_runs = 5 , min_passes = 1 )
305
308
def test_k_map_estimate_analysis_single_field (
306
309
topic_id , subscription_id , bigquery_project , capsys
307
310
):
@@ -323,7 +326,7 @@ def test_k_map_estimate_analysis_single_field(
323
326
assert "Values" in out
324
327
325
328
326
- @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
329
+ @pytest .mark .flaky (max_runs = 5 , min_passes = 1 )
327
330
def test_k_map_estimate_analysis_multiple_field (
328
331
topic_id , subscription_id , bigquery_project , capsys
329
332
):
@@ -345,7 +348,7 @@ def test_k_map_estimate_analysis_multiple_field(
345
348
assert "Values" in out
346
349
347
350
348
- @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
351
+ @pytest .mark .flaky (max_runs = 5 , min_passes = 1 )
349
352
def test_k_map_estimate_analysis_quasi_ids_info_types_equal (
350
353
topic_id , subscription_id , bigquery_project
351
354
):
0 commit comments