Test the compiler properly manages the cache.
()
| 59 | nt.assert_true(len(linecache.cache) > ncache) |
| 60 | |
| 61 | def test_compiler_check_cache(): |
| 62 | """Test the compiler properly manages the cache. |
| 63 | """ |
| 64 | # Rather simple-minded tests that just exercise the API |
| 65 | cp = compilerop.CachingCompiler() |
| 66 | cp.cache('x=1', 99) |
| 67 | # Ensure now that after clearing the cache, our entries survive |
| 68 | linecache.checkcache() |
| 69 | for k in linecache.cache: |
| 70 | if k.startswith('<ipython-input-99'): |
| 71 | break |
| 72 | else: |
| 73 | raise AssertionError('Entry for input-99 missing from linecache') |