Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dvadym committed Dec 4, 2023
1 parent 293841d commit 1e03f07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions analysis/tests/cross_partition_combiners_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ def test_create_report_partition_size_is_used_as_weight_wo_mocks(self):
_, _, weight = combiner.create_accumulator(per_partition_metrics)
self.assertEqual(weight, 5.0)

@patch("analysis.cross_partition_combiners._per_partition_to_utility_report"
)
@patch(
"analysis.cross_partition_combiners._per_partition_to_utility_report")
def test_create_report_with_mocks(self,
mock_per_partition_to_utility_report):
dp_metrics = [pipeline_dp.Metrics.COUNT]
Expand Down
4 changes: 2 additions & 2 deletions tests/combiners_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ def test_noised_value_if_should_keep(self, mock_function):
noise_kind=pipeline_dp.NoiseKind.GAUSSIAN,
pre_threshold=20),
)
@patch('pipeline_dp.partition_selection.create_partition_selection_strategy'
)
@patch(
'pipeline_dp.partition_selection.create_partition_selection_strategy')
def test_mechanism(self, mock_create_partition_selection_strategy,
noise_kind: pipeline_dp.NoiseKind,
pre_threshold: Optional[int]):
Expand Down
21 changes: 10 additions & 11 deletions tests/dp_engine_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,7 @@ def test_aggregate_computation_graph_per_partition_bounding(
unittest.mock.ANY,
unittest.mock.ANY)

@patch(
'pipeline_dp.dp_engine.DPEngine._drop_partitions',)
@patch('pipeline_dp.dp_engine.DPEngine._drop_partitions',)
def test_aggregate_no_partition_filtering_public_partitions(
self, mock_drop_partitions):
# Arrange
Expand Down Expand Up @@ -1110,9 +1109,9 @@ def run_e2e_private_partition_selection_large_budget(self, col, backend):

return col

@unittest.skipIf(sys.version_info.major == 3 and
sys.version_info.minor <= 8,
"dp_accounting library only support python >=3.9")
@unittest.skipIf(
sys.version_info.major == 3 and sys.version_info.minor <= 8,
"dp_accounting library only support python >=3.9")
@parameterized.parameters(False, True)
def test_run_e2e_count_public_partition_local(self, pld_accounting):
Accountant = pipeline_dp.PLDBudgetAccountant if pld_accounting else pipeline_dp.NaiveBudgetAccountant
Expand Down Expand Up @@ -1273,9 +1272,9 @@ def test_min_max_sum_per_partition(self):
self.assertLen(output, 1)
self.assertAlmostEqual(output[0][1].sum, -3, delta=0.1)

@unittest.skipIf(sys.version_info.major == 3 and
sys.version_info.minor <= 8,
"dp_accounting library only support python >=3.9")
@unittest.skipIf(
sys.version_info.major == 3 and sys.version_info.minor <= 8,
"dp_accounting library only support python >=3.9")
def test_pld_not_supported_metrics(self):
with self.assertRaisesRegex(
NotImplementedError,
Expand All @@ -1289,9 +1288,9 @@ def test_pld_not_supported_metrics(self):
engine.aggregate([1], aggregate_params,
self._get_default_extractors(), public_partitions)

@unittest.skipIf(sys.version_info.major == 3 and
sys.version_info.minor <= 8,
"dp_accounting library only support python >=3.9")
@unittest.skipIf(
sys.version_info.major == 3 and sys.version_info.minor <= 8,
"dp_accounting library only support python >=3.9")
def test_pld_not_support_private_partition_selection(self):
with self.assertRaisesRegex(
NotImplementedError,
Expand Down

0 comments on commit 1e03f07

Please sign in to comment.