Skip to content

Commit 88d07b6

Browse files
committed
test: fix locally failing test with envars.
1 parent c107de0 commit 88d07b6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_influxdb_client_3.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ def test_default_client(self):
8989
expected_precision = DefaultWriteOptions.write_precision.value
9090
expected_write_type = DefaultWriteOptions.write_type.value
9191

92+
import os
93+
try:
94+
os.environ["INFLUX_HOST"]
95+
except KeyError:
96+
os.environ["INFLUX_HOST"] = "http://my-influx.io"
97+
98+
try:
99+
os.environ["INFLUX_TOKEN"]
100+
except KeyError:
101+
os.environ["INFLUX_TOKEN"] = "my-token"
102+
103+
try:
104+
os.environ["INFLUX_DATABASE"]
105+
except KeyError:
106+
os.environ["INFLUX_DATABASE"] = "my-bucket"
107+
92108
def verify_client_write_options(c):
93109
write_options = c._write_client_options.get('write_options')
94110
self.assertEqual(write_options.write_precision, expected_precision)

0 commit comments

Comments
 (0)