@@ -42,39 +42,39 @@ def all_tests(c):
42
42
43
43
44
44
@task
45
- def tests (c , uvloop = False , protocol = 2 ):
46
- """Run the redis-py test suite against the current python,
47
- with and without hiredis.
48
- """
45
+ def tests (c , uvloop = False , protocol = 2 , profile = False ):
46
+ """Run the redis-py test suite against the current python."""
49
47
print ("Starting Redis tests" )
50
- standalone_tests (c , uvloop = uvloop , protocol = protocol )
51
- cluster_tests (c , uvloop = uvloop , protocol = protocol )
48
+ standalone_tests (c , uvloop = uvloop , protocol = protocol , profile = profile )
49
+ cluster_tests (c , uvloop = uvloop , protocol = protocol , profile = profile )
52
50
53
51
54
52
@task
55
- def standalone_tests (c , uvloop = False , protocol = 2 ):
53
+ def standalone_tests (c , uvloop = False , protocol = 2 , profile = False ):
56
54
"""Run tests against a standalone redis instance"""
55
+ profile_arg = "--profile" if profile else ""
57
56
if uvloop :
58
57
run (
59
- f"pytest --profile --profile-svg --line-profile --protocol={ protocol } --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --uvloop --junit-xml=standalone-uvloop-results.xml"
58
+ f"pytest { profile_arg } --protocol={ protocol } --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --uvloop --junit-xml=standalone-uvloop-results.xml"
60
59
)
61
60
else :
62
61
run (
63
- f"pytest --profile --profile-svg --line-profile --protocol={ protocol } --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --junit-xml=standalone-results.xml"
62
+ f"pytest { profile_arg } --protocol={ protocol } --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --junit-xml=standalone-results.xml"
64
63
)
65
64
66
65
67
66
@task
68
- def cluster_tests (c , uvloop = False , protocol = 2 ):
67
+ def cluster_tests (c , uvloop = False , protocol = 2 , profile = False ):
69
68
"""Run tests against a redis cluster"""
69
+ profile_arg = "--profile" if profile else ""
70
70
cluster_url = "redis://localhost:16379/0"
71
71
if uvloop :
72
72
run (
73
- f"pytest --profile --profile-svg --line-profile --protocol={ protocol } --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={ cluster_url } --junit-xml=cluster-uvloop-results.xml --uvloop"
73
+ f"pytest { profile_arg } --protocol={ protocol } --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={ cluster_url } --junit-xml=cluster-uvloop-results.xml --uvloop"
74
74
)
75
75
else :
76
76
run (
77
- f"pytest --profile --profile-svg --line-profile --protocol={ protocol } --cov=./ --cov-report=xml:coverage_clusteclient.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={ cluster_url } --junit-xml=cluster-results.xml"
77
+ f"pytest { profile_arg } --protocol={ protocol } --cov=./ --cov-report=xml:coverage_clusteclient.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={ cluster_url } --junit-xml=cluster-results.xml"
78
78
)
79
79
80
80
0 commit comments