Index: lnt/server/db/fieldchange.py =================================================================== --- lnt/server/db/fieldchange.py +++ lnt/server/db/fieldchange.py @@ -159,7 +159,7 @@ if not result.is_result_performance_change() and f: # With more data, its not a regression. Kill it! logger.info("Removing field change: {}".format(f.id)) - deleted = delete_fieldchange(session, ts, f) + delete_fieldchange(session, ts, f) continue if result.is_result_performance_change() and not f: Index: lnt/server/db/migrations/upgrade_14_to_15.py =================================================================== --- lnt/server/db/migrations/upgrade_14_to_15.py +++ lnt/server/db/migrations/upgrade_14_to_15.py @@ -6,7 +6,7 @@ def update_testsuite(engine, db_key_name): table_name = '%s_FieldChange' % db_key_name - with engine.begin() as trans: + with engine.begin(): table = introspect_table(engine, table_name, autoload=False) table.drop(checkfirst=True) Index: lnt/server/db/testsuitedb.py =================================================================== --- lnt/server/db/testsuitedb.py +++ lnt/server/db/testsuitedb.py @@ -49,7 +49,6 @@ """ def __init__(self, v4db, name, test_suite): - testsuitedb = self self.v4db = v4db self.name = name self.test_suite = test_suite Index: lnt/server/reporting/summaryreport.py =================================================================== --- lnt/server/reporting/summaryreport.py +++ lnt/server/reporting/summaryreport.py @@ -344,8 +344,6 @@ samples = session.query(*columns).filter( ts.Sample.run_id.in_(list(run_id_map.keys()))) for sample in samples: - run = run_id_map[sample[0]] - datapoints = list() for key, value in get_datapoints_for_sample(ts, sample): items = self.data_table.get(key) if items is None: Index: lnt/server/ui/api.py =================================================================== --- lnt/server/ui/api.py +++ lnt/server/ui/api.py @@ -195,12 +195,10 @@ @requires_auth_token def put(machine_spec): machine = Machine._get_machine(machine_spec) - machine_name = "%s:%s" % (machine.name, machine.id) data = json.loads(request.data) machine_data = data['machine'] machine.set_from_dict(machine_data) session = request.session - ts = request.get_testsuite() session.commit() @staticmethod Index: lnt/server/ui/profile_views.py =================================================================== --- lnt/server/ui/profile_views.py +++ lnt/server/ui/profile_views.py @@ -67,8 +67,6 @@ profileDir = current_app.old_config.profileDir - idx = 0 - tlc = {} sample = _get_sample(session, ts, runid, testid) if sample and sample.profile: @@ -135,7 +133,6 @@ def v4_profile(testid, run1_id, run2_id=None): session = request.session ts = request.get_testsuite() - profileDir = current_app.old_config.profileDir try: test = session.query(ts.Test).filter(ts.Test.id == testid).one() @@ -151,16 +148,6 @@ # FIXME: Make this a nicer error page. abort(404) - if sample1.profile: - profile1 = sample1.profile - else: - profile1 = None - - if sample2 and sample2.profile: - profile2 = sample2.profile - else: - profile2 = None - json_run1 = { 'id': run1.id, 'order': run1.order.llvm_project_revision, Index: lnt/server/ui/regression_views.py =================================================================== --- lnt/server/ui/regression_views.py +++ lnt/server/ui/regression_views.py @@ -289,7 +289,7 @@ regression_info = session.query(ts.Regression) \ .filter(ts.Regression.id == id) \ .one() - except NoResultFound as e: + except NoResultFound: abort(404) if request.method == 'POST' and request.form['save_btn'] == "Save Changes": regression_info.title = form.title.data @@ -411,7 +411,6 @@ session = request.session ts = request.get_testsuite() field = ts.sample_fields[field_index] - new_regression_id = 0 run = session.query(ts.Run).get(run_id) runs = session.query(ts.Run). \ Index: lnt/server/ui/views.py =================================================================== --- lnt/server/ui/views.py +++ lnt/server/ui/views.py @@ -407,9 +407,6 @@ else: baseline = None - # Gather the runs to use for statistical data. - comparison_start_run = compare_to or self.run - # We're going to render this on a real webpage with CSS support, so # override the default styles and provide bootstrap class names for # the tables. @@ -1520,7 +1517,6 @@ @v4_route("/latest_runs_report") def v4_latest_runs_report(): - session = request.session ts = request.get_testsuite() num_runs_str = request.args.get('num_runs') Index: tests/server/reporting/analysis.py =================================================================== --- tests/server/reporting/analysis.py +++ tests/server/reporting/analysis.py @@ -277,13 +277,13 @@ self.assertEqual(bimodal.get_value_status(), REGRESSED) def test_single_spike(self): - spike = ComparisonResult( + spike = ComparisonResult( # noqa: F841 # relates to commented code min, False, False, [SPIKE[11]], SPIKE[0:10], None, None) # Fixme # self.assertEqual(spike.get_value_status(), UNCHANGED_PASS) def test_noise_single_spike(self): - spike = ComparisonResult( + spike = ComparisonResult( # noqa: F841 # relates to commented code min, False, False, [NOISE_SPIKE[8]], NOISE_SPIKE[0:7], None, None) # Fixme # self.assertEqual(spike.get_value_status(), UNCHANGED_PASS) @@ -300,13 +300,13 @@ self.assertEqual(slow.get_value_status(), REGRESSED) def test_slow_improvement(self): - slow = ComparisonResult( + slow = ComparisonResult( # noqa: F841 # relates to commented code min, False, False, [SLOW_IMP[12]], SLOW_IMP[0:11], None, None) # Fixme # self.assertEqual(slow.get_value_status(), IMPROVED) def test_noise_slow_improvement(self): - slow = ComparisonResult( + slow = ComparisonResult( # noqa: F841 # relates to commented code min, False, False, [SLOW_IMP_NOISE[12]], SLOW_IMP_NOISE[0:11], None, None) # Fixme Index: tests/testing/profilev1impl.py =================================================================== --- tests/testing/profilev1impl.py +++ tests/testing/profilev1impl.py @@ -31,7 +31,7 @@ def test_serialize(self): p = ProfileV1(copy.deepcopy(self.test_data)) with tempfile.NamedTemporaryFile() as f: - s = p.serialize(f.name) + p.serialize(f.name) self.assertTrue(ProfileV1.checkFile(f.name)) def test_deserialize(self): Index: tests/testing/profilev2impl.py =================================================================== --- tests/testing/profilev2impl.py +++ tests/testing/profilev2impl.py @@ -32,7 +32,7 @@ def test_serialize(self): p = ProfileV2.upgrade(ProfileV1(copy.deepcopy(self.test_data))) with tempfile.NamedTemporaryFile() as f: - s = p.serialize(f.name) + p.serialize(f.name) self.assertTrue(ProfileV2.checkFile(f.name)) def test_deserialize(self):