77
88import os
99import json
10- import jsondiff
1110import pytest
1211from breaking_changes_checker .breaking_changes_tracker import BreakingChangesTracker
1312from breaking_changes_checker .detect_breaking_changes import main
@@ -51,9 +50,8 @@ def test_multiple_checkers():
5150 stable = json .load (fd )
5251 with open (os .path .join (os .path .dirname (__file__ ), "test_current.json" ), "r" ) as fd :
5352 current = json .load (fd )
54- diff = jsondiff .diff (stable , current )
5553
56- bc = BreakingChangesTracker (stable , current , diff , "azure-storage-queue" )
54+ bc = BreakingChangesTracker (stable , current , "azure-storage-queue" )
5755 bc .run_checks ()
5856
5957 changes = bc .report_changes ()
@@ -68,15 +66,14 @@ def test_ignore_checks():
6866 stable = json .load (fd )
6967 with open (os .path .join (os .path .dirname (__file__ ), "test_current.json" ), "r" ) as fd :
7068 current = json .load (fd )
71- diff = jsondiff .diff (stable , current )
7269
7370 ignore = {
7471 "azure-storage-queue" : [
7572 ("ChangedParameterOrdering" , "*" , "QueueClient" , "from_connection_string" ),
7673 ]
7774 }
7875
79- bc = BreakingChangesTracker (stable , current , diff , "azure-storage-queue" , ignore = ignore )
76+ bc = BreakingChangesTracker (stable , current , "azure-storage-queue" , ignore = ignore )
8077 bc .run_checks ()
8178
8279 changes = bc .report_changes ()
@@ -91,7 +88,6 @@ def test_ignore_with_wildcard_checks():
9188 stable = json .load (fd )
9289 with open (os .path .join (os .path .dirname (__file__ ), "test_current.json" ), "r" ) as fd :
9390 current = json .load (fd )
94- diff = jsondiff .diff (stable , current )
9591
9692 ignore = {
9793 "azure-storage-queue" : [
@@ -100,7 +96,7 @@ def test_ignore_with_wildcard_checks():
10096 ]
10197 }
10298
103- bc = BreakingChangesTracker (stable , current , diff , "azure-storage-queue" , ignore = ignore )
99+ bc = BreakingChangesTracker (stable , current , "azure-storage-queue" , ignore = ignore )
104100 bc .run_checks ()
105101
106102 changes = bc .report_changes ()
@@ -187,8 +183,7 @@ def test_replace_all_params():
187183 "(RemovedOrRenamedPositionalParam): 'my_function_name' function deleted or renamed its parameter 'testing2' of kind 'positional_or_keyword'"
188184 ]
189185
190- diff = jsondiff .diff (stable , current )
191- bc = BreakingChangesTracker (stable , current , diff , "azure-storage-queue" )
186+ bc = BreakingChangesTracker (stable , current , "azure-storage-queue" )
192187 bc .run_checks ()
193188
194189 changes = bc .report_changes ()
@@ -275,8 +270,7 @@ def test_replace_all_functions():
275270 "(RemovedOrRenamedModuleLevelFunction): Deleted or renamed function 'my_function_name2'"
276271 ]
277272
278- diff = jsondiff .diff (stable , current )
279- bc = BreakingChangesTracker (stable , current , diff , "azure-storage-queue" )
273+ bc = BreakingChangesTracker (stable , current , "azure-storage-queue" )
280274 bc .run_checks ()
281275
282276 changes = bc .report_changes ()
@@ -349,8 +343,7 @@ def test_replace_all_classes():
349343 "(RemovedOrRenamedClass): Deleted or renamed model 'class_name2'"
350344 ]
351345
352- diff = jsondiff .diff (stable , current )
353- bc = BreakingChangesTracker (stable , current , diff , "azure-storage-queue" )
346+ bc = BreakingChangesTracker (stable , current , "azure-storage-queue" )
354347 bc .run_checks ()
355348
356349 changes = bc .report_changes ()
@@ -376,8 +369,7 @@ def test_replace_all_modules():
376369 "(RemovedOrRenamedModule): Deleted or renamed module 'azure.ai.formrecognizer'" ,
377370 ]
378371
379- diff = jsondiff .diff (stable , current )
380- bc = BreakingChangesTracker (stable , current , diff , "azure-storage-queue" )
372+ bc = BreakingChangesTracker (stable , current , "azure-storage-queue" )
381373 bc .run_checks ()
382374
383375 changes = bc .report_changes ()
@@ -433,8 +425,7 @@ def test_removed_operation_group():
433425 "(RemovedOrRenamedOperationGroup): Deleted or renamed client operation group 'ContosoClient.foo'"
434426 ]
435427
436- diff = jsondiff .diff (stable , current )
437- bc = BreakingChangesTracker (stable , current , diff , "azure-storage-queue" )
428+ bc = BreakingChangesTracker (stable , current , "azure-storage-queue" )
438429 bc .run_checks ()
439430
440431 changes = bc .report_changes ()
@@ -452,7 +443,7 @@ def test_async_breaking_changes_cleanup():
452443 ]
453444
454445 # create dummy BreakingChangesTracker instance
455- bct = BreakingChangesTracker ({}, {}, {}, "azure-contoso" )
446+ bct = BreakingChangesTracker ({}, {}, "azure-contoso" )
456447 bct .breaking_changes = breaking_changes
457448
458449 bct .run_async_cleanup (bct .breaking_changes )
@@ -577,8 +568,7 @@ def test_removed_overload():
577568 "(RemovedMethodOverload): class_name.two had all overloads removed"
578569 ]
579570
580- diff = jsondiff .diff (stable , current )
581- bc = BreakingChangesTracker (stable , current , diff , "azure-contoso" , checkers = [MethodOverloadsChecker ()])
571+ bc = BreakingChangesTracker (stable , current , "azure-contoso" , checkers = [MethodOverloadsChecker ()])
582572 bc .run_checks ()
583573
584574 changes = bc .report_changes ()
0 commit comments