Add test for broken/invalid cachefile
This commit is contained in:
parent
7e8f3b31bb
commit
c6a8bea31e
|
@ -1,6 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
from pickle import UnpicklingError
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
@ -64,6 +65,11 @@ def test_cache_needs_parsing(cache, tmpdir):
|
||||||
assert cache.needs_parsing(tmplog_path)
|
assert cache.needs_parsing(tmplog_path)
|
||||||
|
|
||||||
|
|
||||||
|
def test_cache_read_broken_file():
|
||||||
|
with pytest.raises(UnpicklingError):
|
||||||
|
Cache.read('tsstats/__init__.py')
|
||||||
|
|
||||||
|
|
||||||
# INTEGRATION
|
# INTEGRATION
|
||||||
def test_cache_integration(cache_path):
|
def test_cache_integration(cache_path):
|
||||||
first_run = list(parse_logs(
|
first_run = list(parse_logs(
|
||||||
|
|
Loading…
Reference in New Issue