diff --git a/test/regression.py b/test/regression.py index f4f6e866..e4c64db4 100755 --- a/test/regression.py +++ b/test/regression.py @@ -35,6 +35,24 @@ class Base(unittest.TestCase): class TestRegression(Base): + def test_star_import_cache_duration(self): + new = 0.01 + old, api.settings.star_import_cache_validity = \ + api.settings.star_import_cache_validity, new + + imports = api.imports + imports.star_import_cache = {} # first empty... + # path needs to be not-None (otherwise caching effects are not visible) + api.Script('', 1,0, '').complete() + time.sleep(2*new) + api.Script('', 1,0, '').complete() + + # reset values + api.settings.star_import_cache_validity = old + length = len(imports.star_import_cache) + imports.star_import_cache = {} + self.assertEqual(length, 1) + def test_part_parser(self): """ test the get_in_function_call speedups """ s = '\n' * 100 + 'abs(' diff --git a/test/run.py b/test/run.py index db8b2c2f..5ebeec31 100755 --- a/test/run.py +++ b/test/run.py @@ -267,6 +267,7 @@ print('\nSummary: (%s fails)' % tests_fail) for s in summary: print(s) +import mem_debug exit_code = 1 if tests_fail else 0 if sys.hexversion < 0x02060000 and tests_fail <= 5: