Skip to content

Commit

Permalink
tests: conditional mock for telemetry client
Browse files Browse the repository at this point in the history
  • Loading branch information
frascuchon committed Aug 29, 2022
1 parent aea7c2a commit 830d0ee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
def telemetry_track_data(mocker):

client = telemetry._TelemetryClient.get()
# Disable sending data for tests
client._client = telemetry._configure_analytics(disable_send=True)
spy = mocker.spy(client, "track_data")
if client:
# Disable sending data for tests
client._client = telemetry._configure_analytics(disable_send=True)
spy = mocker.spy(client, "track_data")

return spy
return spy


@pytest.fixture
Expand Down

0 comments on commit 830d0ee

Please sign in to comment.