Skip to content

Commit 02de23f

Browse files
authored
Rename all mixedCase globals to snake case to appease N816 (influxdata#689)
Signed-off-by: Matthew McGinn <mamcgi@gmail.com>
1 parent 1cce011 commit 02de23f

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

influxdb/tests/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
import unittest
1313

1414
using_pypy = hasattr(sys, "pypy_version_info")
15-
skipIfPYpy = unittest.skipIf(using_pypy, "Skipping this test on pypy.")
15+
skip_if_pypy = unittest.skipIf(using_pypy, "Skipping this test on pypy.")
1616

1717
_skip_server_tests = os.environ.get(
1818
'INFLUXDB_PYTHON_SKIP_SERVER_TESTS',
1919
None) == 'True'
20-
skipServerTests = unittest.skipIf(_skip_server_tests,
21-
"Skipping server tests...")
20+
skip_server_tests = unittest.skipIf(_skip_server_tests,
21+
"Skipping server tests...")

influxdb/tests/dataframe_client_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import warnings
1414
import requests_mock
1515

16-
from influxdb.tests import skipIfPYpy, using_pypy
16+
from influxdb.tests import skip_if_pypy, using_pypy
1717
from nose.tools import raises
1818

1919
from .client_test import _mocked_session
@@ -24,7 +24,7 @@
2424
from influxdb import DataFrameClient
2525

2626

27-
@skipIfPYpy
27+
@skip_if_pypy
2828
class TestDataFrameClient(unittest.TestCase):
2929
"""Set up a test DataFrameClient object."""
3030

influxdb/tests/influxdb08/dataframe_client_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from nose.tools import raises
1414

15-
from influxdb.tests import skipIfPYpy, using_pypy
15+
from influxdb.tests import skip_if_pypy, using_pypy
1616

1717
from .client_test import _mocked_session
1818

@@ -22,7 +22,7 @@
2222
from influxdb.influxdb08 import DataFrameClient
2323

2424

25-
@skipIfPYpy
25+
@skip_if_pypy
2626
class TestDataFrameClient(unittest.TestCase):
2727
"""Define the DataFramClient test object."""
2828

influxdb/tests/server_tests/client_test_with_server.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from influxdb import InfluxDBClient
2424
from influxdb.exceptions import InfluxDBClientError
2525

26-
from influxdb.tests import skipIfPYpy, using_pypy, skipServerTests
26+
from influxdb.tests import skip_if_pypy, using_pypy, skip_server_tests
2727
from influxdb.tests.server_tests.base import ManyTestCasesWithServerMixin
2828
from influxdb.tests.server_tests.base import SingleTestCaseWithServerMixin
2929

@@ -82,15 +82,15 @@ def point(series_name, timestamp=None, tags=None, **fields):
8282
]
8383

8484
if not using_pypy:
85-
dummy_pointDF = {
85+
dummy_point_df = {
8686
"measurement": "cpu_load_short",
8787
"tags": {"host": "server01",
8888
"region": "us-west"},
8989
"dataframe": pd.DataFrame(
9090
[[0.64]], columns=['value'],
9191
index=pd.to_datetime(["2009-11-10T23:00:00Z"]))
9292
}
93-
dummy_pointsDF = [{
93+
dummy_points_df = [{
9494
"measurement": "cpu_load_short",
9595
"tags": {"host": "server01", "region": "us-west"},
9696
"dataframe": pd.DataFrame(
@@ -120,7 +120,7 @@ def point(series_name, timestamp=None, tags=None, **fields):
120120
]
121121

122122

123-
@skipServerTests
123+
@skip_server_tests
124124
class SimpleTests(SingleTestCaseWithServerMixin, unittest.TestCase):
125125
"""Define the class of simple tests."""
126126

@@ -267,7 +267,7 @@ def test_invalid_port_fails(self):
267267
InfluxDBClient('host', '80/redir', 'username', 'password')
268268

269269

270-
@skipServerTests
270+
@skip_server_tests
271271
class CommonTests(ManyTestCasesWithServerMixin, unittest.TestCase):
272272
"""Define a class to handle common tests for the server."""
273273

@@ -293,15 +293,15 @@ def test_write_points(self):
293293
"""Test writing points to the server."""
294294
self.assertIs(True, self.cli.write_points(dummy_point))
295295

296-
@skipIfPYpy
296+
@skip_if_pypy
297297
def test_write_points_DF(self):
298298
"""Test writing points with dataframe."""
299299
self.assertIs(
300300
True,
301301
self.cliDF.write_points(
302-
dummy_pointDF['dataframe'],
303-
dummy_pointDF['measurement'],
304-
dummy_pointDF['tags']
302+
dummy_point_df['dataframe'],
303+
dummy_point_df['measurement'],
304+
dummy_point_df['tags']
305305
)
306306
)
307307

@@ -342,7 +342,7 @@ def test_write_points_check_read_DF(self):
342342
rsp = self.cliDF.query('SELECT * FROM cpu_load_short')
343343
assert_frame_equal(
344344
rsp['cpu_load_short'],
345-
dummy_pointDF['dataframe']
345+
dummy_point_df['dataframe']
346346
)
347347

348348
# Query with Tags
@@ -351,7 +351,7 @@ def test_write_points_check_read_DF(self):
351351
assert_frame_equal(
352352
rsp[('cpu_load_short',
353353
(('host', 'server01'), ('region', 'us-west')))],
354-
dummy_pointDF['dataframe']
354+
dummy_point_df['dataframe']
355355
)
356356

357357
def test_write_multiple_points_different_series(self):
@@ -407,21 +407,21 @@ def test_write_multiple_points_different_series_DF(self):
407407
for i in range(2):
408408
self.assertIs(
409409
True, self.cliDF.write_points(
410-
dummy_pointsDF[i]['dataframe'],
411-
dummy_pointsDF[i]['measurement'],
412-
dummy_pointsDF[i]['tags']))
410+
dummy_points_df[i]['dataframe'],
411+
dummy_points_df[i]['measurement'],
412+
dummy_points_df[i]['tags']))
413413
time.sleep(1)
414414
rsp = self.cliDF.query('SELECT * FROM cpu_load_short')
415415

416416
assert_frame_equal(
417417
rsp['cpu_load_short'],
418-
dummy_pointsDF[0]['dataframe']
418+
dummy_points_df[0]['dataframe']
419419
)
420420

421421
rsp = self.cliDF.query('SELECT * FROM memory')
422422
assert_frame_equal(
423423
rsp['memory'],
424-
dummy_pointsDF[1]['dataframe']
424+
dummy_points_df[1]['dataframe']
425425
)
426426

427427
def test_write_points_batch(self):
@@ -786,7 +786,7 @@ def test_query_multiple_series(self):
786786
self.cli.write_points(pts)
787787

788788

789-
@skipServerTests
789+
@skip_server_tests
790790
class UdpTests(ManyTestCasesWithServerMixin, unittest.TestCase):
791791
"""Define a class to test UDP series."""
792792

0 commit comments

Comments
 (0)