Add test for broken/invalid cachefile

This commit is contained in:
Thor77 2018-02-05 15:49:21 +01:00
parent 7e8f3b31bb
commit c6a8bea31e
1 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import os
import shutil
from pickle import UnpicklingError
import pytest
@ -64,6 +65,11 @@ def test_cache_needs_parsing(cache, tmpdir):
assert cache.needs_parsing(tmplog_path)
def test_cache_read_broken_file():
with pytest.raises(UnpicklingError):
Cache.read('tsstats/__init__.py')
# INTEGRATION
def test_cache_integration(cache_path):
first_run = list(parse_logs(