Skip to content

Commit

Permalink
Using setup.py nosetests to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Mar 28, 2016
1 parent 6dce6df commit 301dce2
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 38 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ before_install:
- rm -rf ~/.npm
- mkdir ~/.npm
install:
- pip wheel -w $HOME/.wheelhouse -f $HOME/.wheelhouse -r requirements.txt
- pip install --find-links=$HOME/.wheelhouse --no-index -rrequirements.txt
- python setup.py install
- pip wheel -w $HOME/.wheelhouse -f $HOME/.wheelhouse .
- pip install --find-links=$HOME/.wheelhouse --no-index .
- cd dashed/assets
- npm install
- npm run lint
Expand All @@ -20,4 +19,3 @@ install:
script: bash run_tests.sh
after_success:
- coveralls
- cd dashed/assets
3 changes: 2 additions & 1 deletion dashed/assets/visualizations/nvd3_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@ function nvd3Vis(slice) {
xAxisFormatter = d3.format('.3s');
} else if (fd.x_axis_format === 'smart_date') {
xAxisFormatter = px.formatDate;
chart.xAxis.tickFormat(xAxisFormatter);
} else if (fd.x_axis_format !== undefined) {
xAxisFormatter = px.timeFormatFactory(fd.x_axis_format);
chart.xAxis.tickFormat(xAxisFormatter);
}
chart.xAxis.tickFormat(xAxisFormatter);

if (chart.hasOwnProperty("x2Axis")) {
chart.x2Axis.tickFormat(xAxisFormatter);
Expand Down
4 changes: 2 additions & 2 deletions dashed/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def query_obj(self):
def get_data(self):
form_data = self.form_data
df = self.get_df()
df = df.sort(columns=df.columns[0])
df.sort(columns=df.columns[0], inplace=True)
compare_lag = form_data.get("compare_lag", "")
compare_lag = int(compare_lag) if compare_lag and compare_lag.isdigit() else 0
return {
Expand Down Expand Up @@ -802,7 +802,7 @@ def get_df(self, query_obj=None):
df = df.pivot_table(
index=self.groupby,
values=[self.metrics[0]])
df = df.sort(self.metrics[0], ascending=False)
df.sort(self.metrics[0], ascending=False, inplace=True)
return df

def get_data(self):
Expand Down
2 changes: 2 additions & 0 deletions dev-reqs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx
sphinx_bootstrap_theme
28 changes: 0 additions & 28 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
rm /tmp/dashed_unittests.db
export DASHED_CONFIG=tests.dashed_test_config
dashed/bin/dashed db upgrade
nosetests tests/core_tests.py --with-coverage --cover-package=dashed -v
python setup.py nosetests
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ all_files = 1

[upload_sphinx]
upload-dir = docs/_build/html

[nosetests]
verbosity=1
detailed-errors=1
with-coverage=1
cover-package=dashed
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
'pydruid>=0.2.2, <0.3',
'python-dateutil>=2.4.2, <3.0.0',
'requests>=2.7.0, <3.0.0',
'sqlalchemy-utils>=0.31.3, <0.32.0',
'sqlalchemy>=1.0.12, <2.0.0',
'sqlalchemy-utils>=0.31.3, <0.32.0',
'sqlparse>=0.1.16, <0.2.0',
'werkzeug>=0.11.2, <0.12.0',
],
tests_require=['coverage'],
author='Maxime Beauchemin',
author_email='[email protected]',
url='https://github.com/airbnb/dashed',
Expand Down
2 changes: 1 addition & 1 deletion tests/panoramix_test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from panoramix.config import *
from dashed.config import *

AUTH_USER_REGISTRATION_ROLE = 'alpha'
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/panoramix_unittests.db'
Expand Down

0 comments on commit 301dce2

Please sign in to comment.