commit 48822189916c36067bdb86c527b096bb72320424 Author: aagbsn aagbsn@extc.org Date: Thu Jul 25 13:36:29 2013 +0200
Get the input processor as late as possible --- ooni/nettest.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/ooni/nettest.py b/ooni/nettest.py index 10eacd3..92c9864 100644 --- a/ooni/nettest.py +++ b/ooni/nettest.py @@ -360,11 +360,6 @@ class NetTestLoader(object): test_instance._checkRequiredOptions() test_instance._checkValidOptions()
- inputs = test_instance.getInputProcessor() - if not inputs: - inputs = [None] - klass.inputs = inputs - def _get_test_methods(self, item): """ Look for test_ methods in subclasses of NetTestCase @@ -501,7 +496,14 @@ class NetTest(object): This is a generator that yields measurements and registers the callbacks for when a measurement is successful or has failed. """ + for test_class, test_methods in self.testCases: + # load the input processor as late as possible + inputs = test_class().getInputProcessor() + if not inputs: + inputs = [None] + test_class.inputs = inputs + for input in test_class.inputs: for method in test_methods: log.debug("Running %s %s" % (test_class, method))
tor-commits@lists.torproject.org