mirror of
https://github.com/wassname/cachier.git
synced 2026-09-26 13:40:44 +08:00
fixing python versions
This commit is contained in:
+5
-5
@@ -21,7 +21,7 @@ matrix:
|
||||
before_install:
|
||||
- python --version
|
||||
# - pip install -U pip
|
||||
- python -m pip install --upgrade pip
|
||||
# - python -m pip install --upgrade pip
|
||||
- pip install pytest
|
||||
- pip install codecov
|
||||
- pip install pymongo
|
||||
@@ -62,21 +62,21 @@ matrix:
|
||||
- pip install --upgrade pytest
|
||||
- pip install codecov
|
||||
env: PATH=/c/Python27:/c/Python27/Scripts:$PATH
|
||||
- name: "Python 3.5.7 on Windows"
|
||||
- name: "Python 3.5.4 on Windows"
|
||||
os: windows # Windows 10.0.17134 N/A Build 17134
|
||||
language: shell # 'language: python' is an error on Travis CI Windows
|
||||
before_install:
|
||||
- choco install python --version 3.5.7
|
||||
- choco install python --version 3.5.4
|
||||
- python --version
|
||||
- python -m pip install --upgrade pip
|
||||
- pip3 install --upgrade pytest
|
||||
- pip3 install codecov
|
||||
env: PATH=/c/Python35:/c/Python35/Scripts:$PATH
|
||||
- name: "Python 3.6.9 on Windows"
|
||||
- name: "Python 3.6.8 on Windows"
|
||||
os: windows # Windows 10.0.17134 N/A Build 17134
|
||||
language: shell # 'language: python' is an error on Travis CI Windows
|
||||
before_install:
|
||||
- choco install python --version 3.6.9
|
||||
- choco install python --version 3.6.8
|
||||
- python --version
|
||||
- python -m pip install --upgrade pip
|
||||
- pip3 install --upgrade pytest
|
||||
|
||||
@@ -306,7 +306,7 @@ def _calls_delete_cache(res_queue, del_cache):
|
||||
res_queue.put(exc)
|
||||
|
||||
|
||||
def test_delete_cache_file():
|
||||
def _helper_delete_cache_file(sleeptime):
|
||||
"""Test pickle core handling of missing cache files."""
|
||||
_delete_cache.clear_cache()
|
||||
res_queue = queue.Queue()
|
||||
@@ -317,20 +317,35 @@ def test_delete_cache_file():
|
||||
target=_calls_delete_cache,
|
||||
kwargs={'res_queue': res_queue, 'del_cache': False})
|
||||
thread1.start()
|
||||
sleep(0.5)
|
||||
sleep(sleeptime)
|
||||
thread2.start()
|
||||
thread1.join()
|
||||
thread2.join()
|
||||
assert res_queue.qsize() == 2
|
||||
if not res_queue.qsize() == 2:
|
||||
return False
|
||||
res1 = res_queue.get()
|
||||
# print(res1)
|
||||
assert isinstance(res1, float)
|
||||
if not isinstance(res1, float):
|
||||
return False
|
||||
res2 = res_queue.get()
|
||||
assert isinstance(res2, KeyError) or (res2 is None)
|
||||
if not (isinstance(res2, KeyError)) or (
|
||||
(res2 is None)):
|
||||
return False
|
||||
return True
|
||||
# print(res2)
|
||||
# print(type(res2))
|
||||
|
||||
|
||||
def test_delete_cache_file():
|
||||
"""Test pickle core handling of missing cache files."""
|
||||
sleeptimes = [0.5, 0.3, 0.1, 0.2, 0.8, 1]
|
||||
sleeptimes = sleeptimes + sleeptimes
|
||||
for sleeptime in sleeptimes:
|
||||
if _helper_delete_cache_file(sleeptime):
|
||||
return
|
||||
assert False
|
||||
|
||||
|
||||
def test_clear_being_calculated():
|
||||
"""Test pickle core clear `being calculated` functionality."""
|
||||
_takes_time.clear_being_calculated()
|
||||
|
||||
Reference in New Issue
Block a user