Commit 7bdfcf7c3df2a51d0a56cd7f6a732b967023365a

Authored by Christian Herdtweck
1 parent 225312a8

tests: Reduce output from oleobj tests even further

Showing 1 changed file with 7 additions and 3 deletions
tests/oleobj/test_basic.py
@@ -118,12 +118,15 @@ class TestOleObj(unittest.TestCase): @@ -118,12 +118,15 @@ class TestOleObj(unittest.TestCase):
118 msg='Wrong return value {} for {}. Output:\n{}' 118 msg='Wrong return value {} for {}. Output:\n{}'
119 .format(ret_val, sample_name, output)) 119 .format(ret_val, sample_name, output))
120 120
121 - def do_test_md5(self, args, test_fun=None): 121 + def do_test_md5(self, args, test_fun=None, only_run_every=1):
122 """ helper for test_md5 and test_md5_args """ 122 """ helper for test_md5 and test_md5_args """
123 data_dir = join(DATA_BASE_DIR, 'oleobj') 123 data_dir = join(DATA_BASE_DIR, 'oleobj')
124 124
125 # name of sample, extension of embedded file, md5 hash of embedded file 125 # name of sample, extension of embedded file, md5 hash of embedded file
126 - for sample_name, embedded_name, expect_hash in SAMPLES: 126 + for sample_index, (sample_name, embedded_name, expect_hash) \
  127 + in enumerate(SAMPLES):
  128 + if sample_index % only_run_every != 0:
  129 + continue
127 args_with_path = args + [join(data_dir, sample_name), ] 130 args_with_path = args + [join(data_dir, sample_name), ]
128 if test_fun is None: 131 if test_fun is None:
129 output, ret_val = call_and_capture('oleobj', args_with_path, 132 output, ret_val = call_and_capture('oleobj', args_with_path,
@@ -150,7 +153,8 @@ class TestOleObj(unittest.TestCase): @@ -150,7 +153,8 @@ class TestOleObj(unittest.TestCase):
150 153
151 def test_non_streamed(self): 154 def test_non_streamed(self):
152 """ Ensure old oleobj behaviour still works: pre-read whole file """ 155 """ Ensure old oleobj behaviour still works: pre-read whole file """
153 - return self.do_test_md5(['-d', self.temp_dir], test_fun=preread_file) 156 + return self.do_test_md5(['-d', self.temp_dir], test_fun=preread_file,
  157 + only_run_every=4)
154 158
155 159
156 # just in case somebody calls this file as a script 160 # just in case somebody calls this file as a script