Chromium Code Reviews| Index: tools/perf/benchmarks/benchmark_smoke_unittest.py |
| diff --git a/tools/perf/benchmarks/benchmark_smoke_unittest.py b/tools/perf/benchmarks/benchmark_smoke_unittest.py |
| index bed257ebb9736c0a777a899a4fc23aed7018d43f..901a373c95154ed6a578a784b49340f405e66e55 100644 |
| --- a/tools/perf/benchmarks/benchmark_smoke_unittest.py |
| +++ b/tools/perf/benchmarks/benchmark_smoke_unittest.py |
| @@ -103,10 +103,17 @@ def load_tests(_, _2, _3): |
| # (above), if that test is disabled, we'll end up not running *any* |
| # test from the class. We should probably discover all of the tests |
| # in a class, and then throw the ones we don't need away instead. |
| - if hasattr(benchmark, '_enabled_strings'): |
| - method._enabled_strings = benchmark._enabled_strings |
| - if hasattr(benchmark, '_disabled_strings'): |
| - method._disabled_strings = benchmark._disabled_strings |
| + |
| + # Merge decorators. |
| + for attr in ['_enabled_strings', '_disabled_strings']: |
|
dtu
2015/05/05 21:09:08
style nit: don't abbreviate (not in google style g
achuithb
2015/05/05 22:01:10
Done.
|
| + tmp = set() |
|
dtu
2015/05/05 21:09:08
Shorter:
merged_attributes = set(getattr(method,
achuithb
2015/05/05 22:01:10
Done.
|
| + if hasattr(method, attr): |
| + tmp.update(getattr(method, attr)) |
| + if hasattr(benchmark, attr): |
| + tmp.update(getattr(benchmark, attr)) |
| + if tmp: |
| + setattr(method, attr, list(tmp)) |
| + |
| setattr(BenchmarkSmokeTest, benchmark.Name(), method) |
| suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |