Skip to content

Commit

Permalink
fix: Use sys.executable
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Jul 4, 2019
1 parent 7673551 commit 0554455
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/integrations/stdlib/test_subprocess.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import subprocess
import sys

from sentry_sdk import Hub, capture_message
from sentry_sdk.integrations.stdlib import StdlibIntegration
Expand All @@ -8,15 +9,14 @@ def test_subprocess_basic(sentry_init, capture_events):
sentry_init(integrations=[StdlibIntegration()], traces_sample_rate=1.0)

with Hub.current.trace(transaction="foo", op="foo") as span:
output = subprocess.check_output(
"python -c '"
output = subprocess.check_output([
sys.executable,
'-c',
"import sentry_sdk; "
"from sentry_sdk.integrations.stdlib import get_subprocess_traceparent_headers; "
"sentry_sdk.init(); "
"print(dict(get_subprocess_traceparent_headers()))"
"'",
shell=True,
)
])

assert span.trace_id in str(output)

Expand Down

0 comments on commit 0554455

Please sign in to comment.