Skip to content

Commit 074e5ab

Browse files
authored
ci/test: speed_eval (#232)
1 parent 91a53da commit 074e5ab

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

.github/workflows/ci-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ jobs:
7878
- name: Unit tests (DB)
7979
if: matrix.backend == 'db'
8080
run: pytest -m "mongo"
81+
- name: Speed eval
82+
run: python tests/speed_eval.py
8183

82-
- name: "Upload coverage to Codecov"
84+
- name: Upload coverage to Codecov
8385
continue-on-error: true
8486
uses: codecov/codecov-action@v4
8587
with:

tests/test_defaults.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
import cachier
99
import pytest
1010

11-
from tests.test_mongo_core import MONGO_DELTA, _test_mongetter
11+
from tests.test_mongo_core import _test_mongetter
1212

13+
MONGO_DELTA = datetime.timedelta(seconds=3)
1314
_default_params = cachier.get_default_params().copy()
1415

1516

tests/test_general.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Non-core-specific tests for cachier."""
22

3+
import datetime
34
import functools
45
import os
56
import queue
@@ -20,10 +21,11 @@
2021
)
2122

2223
from tests.test_mongo_core import (
23-
MONGO_DELTA_LONG,
2424
_test_mongetter,
2525
)
2626

27+
MONGO_DELTA_LONG = datetime.timedelta(seconds=10)
28+
2729

2830
def test_information():
2931
print("\ncachier version: ", end="")

tests/test_mongo_core.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import queue
77
import sys
88
import threading
9-
from datetime import timedelta
109
from random import random
1110
from time import sleep
1211
from urllib.parse import quote_plus
@@ -146,16 +145,14 @@ def _test_mongo_caching(arg_1, arg_2):
146145
assert val6 == val5
147146

148147

149-
MONGO_DELTA = timedelta(seconds=3)
150-
MONGO_DELTA_LONG = timedelta(seconds=10)
151-
152-
153148
@pytest.mark.mongo()
154149
def test_mongo_stale_after():
155150
"""Testing MongoDB core stale_after functionality."""
156151

157152
@cachier(
158-
mongetter=_test_mongetter, stale_after=MONGO_DELTA, next_time=False
153+
mongetter=_test_mongetter,
154+
stale_after=datetime.timedelta(seconds=3),
155+
next_time=False,
159156
)
160157
def _stale_after_mongo(arg_1, arg_2):
161158
"""Some function."""

0 commit comments

Comments
 (0)