Skip to content

Commit 62a6d32

Browse files
authored
test: Add rq 1.5 to test matrix (getsentry#768)
1 parent 28e3ca5 commit 62a6d32

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

tests/integrations/rq/test_rq.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
from sentry_sdk.integrations.rq import RqIntegration
22

3+
import pytest
4+
35
from fakeredis import FakeStrictRedis
46
import rq
57

68

9+
@pytest.fixture(autouse=True)
10+
def _patch_rq_get_server_version(monkeypatch):
11+
"""
12+
Patch up RQ 1.5 to work with fakeredis.
13+
14+
https://github.com/jamesls/fakeredis/issues/273
15+
"""
16+
17+
from distutils.version import StrictVersion
18+
19+
if tuple(map(int, rq.VERSION.split("."))) >= (1, 5):
20+
for k in (
21+
"rq.job.Job.get_redis_server_version",
22+
"rq.worker.Worker.get_redis_server_version",
23+
):
24+
monkeypatch.setattr(k, lambda _: StrictVersion("4.0.0"))
25+
26+
727
def crashing_job(foo):
828
1 / 0
929

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ envlist =
4848

4949
{pypy,py2.7,py3.5,py3.6}-rq-{0.6,0.7,0.8,0.9,0.10,0.11}
5050
{pypy,py2.7,py3.5,py3.6,py3.7,py3.8}-rq-{0.12,0.13,1.0,1.1,1.2,1.3}
51-
{py3.5,py3.6,py3.7,py3.8}-rq-1.4
51+
{py3.5,py3.6,py3.7,py3.8}-rq-{1.4,1.5}
5252

5353
py3.7-aiohttp-3.5
5454
{py3.7,py3.8}-aiohttp-3.6
@@ -139,7 +139,7 @@ deps =
139139
# https://github.com/jamesls/fakeredis/issues/245
140140
rq-{0.6,0.7,0.8,0.9,0.10,0.11,0.12}: fakeredis<1.0
141141
rq-{0.6,0.7,0.8,0.9,0.10,0.11,0.12}: redis<3.2.2
142-
rq-{0.13,1.0,1.1,1.2,1.3,1.4}: fakeredis>=1.0
142+
rq-{0.13,1.0,1.1,1.2,1.3,1.4,1.5}: fakeredis>=1.0
143143

144144
rq-0.6: rq>=0.6,<0.7
145145
rq-0.7: rq>=0.7,<0.8
@@ -154,6 +154,7 @@ deps =
154154
rq-1.2: rq>=1.2,<1.3
155155
rq-1.3: rq>=1.3,<1.4
156156
rq-1.4: rq>=1.4,<1.5
157+
rq-1.5: rq>=1.5,<1.6
157158

158159
aiohttp-3.4: aiohttp>=3.4.0,<3.5.0
159160
aiohttp-3.5: aiohttp>=3.5.0,<3.6.0

0 commit comments

Comments
 (0)