Skip to content

Commit 0520ec8

Browse files
Kyle-Verhoogjd
andauthored
fmt: black celery tests (#1314)
* celery: black fmt tests * celery: use self.assert_is_measured Co-authored-by: Julien Danjou <[email protected]>
1 parent edd5c25 commit 0520ec8

File tree

9 files changed

+236
-236
lines changed

9 files changed

+236
-236
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ exclude = '''
105105
| botocore
106106
| bottle
107107
| cassandra
108-
| celery
109108
| config.py
110109
| consul
111110
| dbapi

tests/contrib/celery/autopatch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from ddtrace import Pin
22

3-
if __name__ == '__main__':
3+
if __name__ == "__main__":
44
# have to import celery in order to have the post-import hooks run
55
import celery
66

77
# now celery.Celery should be patched and should have a pin
88
assert Pin.get_from(celery.Celery)
9-
print('Test success')
9+
print("Test success")

tests/contrib/celery/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from ...base import BaseTracerTestCase
99

1010

11-
REDIS_URL = 'redis://127.0.0.1:{port}'.format(port=REDIS_CONFIG['port'])
12-
BROKER_URL = '{redis}/{db}'.format(redis=REDIS_URL, db=0)
13-
BACKEND_URL = '{redis}/{db}'.format(redis=REDIS_URL, db=1)
11+
REDIS_URL = "redis://127.0.0.1:{port}".format(port=REDIS_CONFIG["port"])
12+
BROKER_URL = "{redis}/{db}".format(redis=REDIS_URL, db=0)
13+
BACKEND_URL = "{redis}/{db}".format(redis=REDIS_URL, db=1)
1414

1515

1616
class CeleryBaseTestCase(BaseTracerTestCase):
@@ -23,8 +23,8 @@ def setUp(self):
2323

2424
# instrument Celery and create an app with Broker and Result backends
2525
patch()
26-
self.pin = Pin(service='celery-unittest', tracer=self.tracer)
27-
self.app = Celery('celery.test_app', broker=BROKER_URL, backend=BACKEND_URL)
26+
self.pin = Pin(service="celery-unittest", tracer=self.tracer)
27+
self.app = Celery("celery.test_app", broker=BROKER_URL, backend=BACKEND_URL)
2828
# override pins to use our Dummy Tracer
2929
Pin.override(self.app, tracer=self.tracer)
3030

tests/contrib/celery/test_autopatch.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@ class DdtraceRunTest(unittest.TestCase):
77
"""Test that celery is patched successfully if run with ddtrace-run."""
88

99
def test_autopatch(self):
10-
out = subprocess.check_output(
11-
['ddtrace-run', 'python', 'tests/contrib/celery/autopatch.py']
12-
)
13-
assert out.startswith(b'Test success')
10+
out = subprocess.check_output(["ddtrace-run", "python", "tests/contrib/celery/autopatch.py"])
11+
assert out.startswith(b"Test success")

0 commit comments

Comments
 (0)