Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed Sep 19, 2015
1 parent 6c1f442 commit ec1d5e6
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 10 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ tests/config/home-assistant.log
*.sublime-project
*.sublime-workspace

# Hide code validator output
pep8.txt
pylint.txt

# Hide some OS X stuff
.DS_Store
.AppleDouble
Expand All @@ -30,6 +26,9 @@ Icon

.idea

# pytest
.cache

# GITHUB Proposed Python stuff:
*.py[cod]

Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/automation/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def time_if():
now = dt_util.now()
if before is not None and now > now.replace(hour=before.hour,
minute=before.minute):
return False
return False

if after is not None and now < now.replace(hour=after.hour,
minute=after.minute):
return False
return False

if weekday is not None:
now_weekday = WEEKDAYS[now.weekday()]
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/logbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def humanify(events):
if event.event_type == EVENT_STATE_CHANGED:
entity_id = event.data['entity_id']

if entity_id is None:
continue

if entity_id.startswith('sensor.'):
last_sensor_event[entity_id] = event

Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
testpaths = tests
5 changes: 5 additions & 0 deletions script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
# designed to run on the continuous integration server.

script/test coverage

STATUS=$?

coveralls

exit $STATUS
11 changes: 10 additions & 1 deletion script/lint
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
cd "$(dirname "$0")/.."

echo "Checking style with flake8..."
flake8 homeassistant
flake8 --exclude www_static homeassistant

STATUS=$?

echo "Checking style with pylint..."
pylint homeassistant

if [ $STATUS -eq 0 ]
then
exit $?
else
exit $STATUS
fi
13 changes: 11 additions & 2 deletions script/test
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ cd "$(dirname "$0")/.."

script/lint

STATUS=$?

echo "Running tests..."

if [ "$1" = "coverage" ]; then
py.test --cov homeassistant tests
py.test --cov --cov-report=
else
py.test
fi

if [ $STATUS -eq 0 ]
then
exit $?
else
py.test tests
exit $STATUS
fi

0 comments on commit ec1d5e6

Please sign in to comment.