From 0cd6901655a1491d82c6bec216dce7ccdf4f4e29 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 14 Oct 2016 16:40:07 -0700 Subject: framework/profile: Don't alter the TestProfile before running This patch changes the way that the tests from TestProfile are processed. Rather than having a process_test_list method that modifies TestProfile.test_list, a new itertests() method creates an iterator that yields tests that are not excluded by filters. This saves a bit of code, increases the memory usage, and reduces surprise. It would be nice if there wasn't a need to create a concrete test list, but there wouldn't be any way to get the number of tests otherwise. Signed-off-by: Dylan Baker --- unittests/framework/test_profile.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'unittests') diff --git a/unittests/framework/test_profile.py b/unittests/framework/test_profile.py index ea4ee7063..9ac0d2176 100644 --- a/unittests/framework/test_profile.py +++ b/unittests/framework/test_profile.py @@ -211,12 +211,6 @@ class TestTestProfile(object): assert fixture.test_list == new.test_list assert fixture.test_list is not new.test_list - def test_prepare_test_list(self, fixture): - """The prepare_test_list method doesn't affect both.""" - new = fixture.copy() - new.prepare_test_list() - assert new.test_list != fixture.test_list - class TestTestDict(object): """Tests for the TestDict object.""" -- cgit v1.2.3