Skip to content

Commit

Permalink
inline method into decorator
Browse files Browse the repository at this point in the history
The _test_nCoresPerRun method is a remainder of prior refactoring - as it only contains a single call to another
function, we can remove and inline its content safely
  • Loading branch information
schroeding committed Dec 14, 2024
1 parent 65c25be commit f27dea5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions benchexec/test_core_assignment_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def expect_assignment(

def class_decorator(c) -> callable:
def decorator_test_assignment(self):
self._test_nCoresPerRun(number_cores, expected_assignment, max_threads)
self.mainAssertValid(number_cores, expected_assignment, max_threads)

dynamic_test_name = f"test_{number_cores}_cores_assignment"
setattr(c, dynamic_test_name, decorator_test_assignment)
Expand Down Expand Up @@ -159,9 +159,6 @@ def mainAssertValid(self, coreLimit, expectedResult, maxThreads=None):

use_hyperthreading = True

def _test_nCoresPerRun(self, coreLimit, expected_assignment, max_threads=None):
self.mainAssertValid(coreLimit, expected_assignment, max_threads)


@expect_assignment(1, [[x] for x in range(8)])
@expect_assignment(2, [[0, 1], [2, 3], [4, 5], [6, 7]])
Expand Down

0 comments on commit f27dea5

Please sign in to comment.