8000 Test suite improvements (#333) (Thanks @babilen!) · MatijaB/influxdb-python@68c95e5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 68c95e5

Browse files
wwentlandaviau
authored andcommitted
Test suite improvements (influxdata#333) (Thanks @BABILEN!)
* Import py3 compatibility future statements * Consistent formatting for dictionary literals This makes it easier to see changes to test data in diffs. * Add 'shardGroupDuration' in retention policy tests This information was introduced in InfluxDB 0.10.0 and tests fail without it. * Perform correct default retention policy switching There can only be a single default retention policy per database. * Update InfluxDB version to 0.13.0 This will run tests on travis using 0.13.0 * travis: upgrade wget * Drop Python 2.6 support This removes tests and compatibility code for Python 2.6. * Fix PEP8 errors
1 parent 81300de commit 68c95e5

29 files changed

+232
-98
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
language: python
2+
addons:
3+
apt:
4+
packages:
5+
- wget
26
env:
3-
# - TOX_ENV=py26
4-
# If someone opens a PR to re-enable py26 tests, I will merge it.
5-
# However, that cannot be at the cost of disabling pandas tests in other
6-
# environments.
77
- TOX_ENV=py27
88
# - TOX_ENV=py32
99
# Disabling py32 tests until the following issue is fixed:
@@ -20,7 +20,7 @@ install:
2020
- pip install tox
2121
- pip install coveralls
2222
- mkdir influxdb_install
23-
- wget https://s3.amazonaws.com/influxdb/influxdb_0.12.1-1_amd64.deb
23+
- wget https://dl.influxdata.com/influxdb/releases/influxdb_0.13.0_amd64.deb
2424
- dpkg -x influxdb*.deb influxdb_install
2525
script:
2626
- export INFLUXDB_PYTHON_INFLUXD_PATH=$(pwd)/influxdb_install/usr/bin/influxd

influxdb/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# -*- coding: utf-8 -*-
2+
3+
from __future__ import absolute_import
4+
from __future__ import division
5+
from __future__ import print_function
6+
from __future__ import unicode_literals
7+
28
from .client import InfluxDBClient
39
from .client import InfluxDBClusterClient
410
from .dataframe_client import DataFrameClient

influxdb/_dataframe_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"""
33
DataFrame client for InfluxDB
44
"""
5+
from __future__ import absolute_import
6+
from __future__ import division
7+
from __future__ import print_function
8+
from __future__ import unicode_literals
9+
510
import math
611

712
import pandas as pd

influxdb/chunked_json.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
# Source: https://gist.github.com/sampsyo/920215
66
#
77

8+
from __future__ import absolute_import
9+
from __future__ import division
10+
from __future__ import print_function
11+
from __future__ import unicode_literals
12+
813
import json
914

1015
_decoder = json.JSONDecoder()

influxdb/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"""
33
Python client for InfluxDB
44
"""
5+
from __future__ import absolute_import
6+
from __future__ import division
7+
from __future__ import print_function
8+
from __future__ import unicode_literals
59

610
from functools import wraps
711
import json

influxdb/dataframe_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"""
33
DataFrame client for InfluxDB
44
"""
5+
from __future__ import absolute_import
6+
from __future__ import division
7+
from __future__ import print_function
8+
from __future__ import unicode_literals
59

610
__all__ = ['DataFrameClient']
711

influxdb/exceptions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
from __future__ import absolute_import
2+
from __future__ import division
3+
from __future__ import print_function
4+
from __future__ import unicode_literals
5+
6+
17
class InfluxDBClientError(Exception):
28
"""Raised when an error occurs in the request."""
39
def __init__(self, content, code=None):

influxdb/helper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"""
33
Helper class for InfluxDB
44
"""
5+
from __future__ import absolute_import
6+
from __future__ import division
7+
from __future__ import print_function
8+
from __future__ import unicode_literals
9+
510
from collections import namedtuple, defaultdict
611
from datetime import datetime
712
from warnings import warn

influxdb/influxdb08/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# -*- coding: utf-8 -*-
2+
3+
from __future__ import absolute_import
4+
from __future__ import division
5+
from __future__ import print_function
6+
from __future__ import unicode_literals
7+
28
from .client import InfluxDBClient
39
from .dataframe_client import DataFrameClient
410
from .helper import SeriesHelper

influxdb/influxdb08/chunked_json.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
# Source: https://gist.github.com/sampsyo/920215
66
#
77

8+
from __future__ import absolute_import
9+
from __future__ import division
10+
from __future__ import print_function
11+
from __future__ import unicode_literals
12+
813
import json
914

1015
_decoder = json.JSONDecoder()

0 commit comments

Comments
 (0)
0