Skip to content

Conversation

@deparkes
Copy link
Contributor

@deparkes deparkes commented Oct 1, 2016

I was trying to work through your example using this code:

# Get the current timestep from the forecast
current_timestep = forecast.now()

# Print out the site and current weather
print site.name, "-", current_timestep.weather.text

and getting an error as forecast.now() would always return False, and not a timestep object.

It looked to me like the problem was the if statement was comparing two different types, so would never be True.

This fix seems to get the example working for me.

My Python version is: Python 3.5.2 |Anaconda 4.1.1 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)]

@jacobtomlinson
Copy link
Collaborator

This is great thanks. Do you think you could write a unit test which exposes the bug?

@deparkes
Copy link
Contributor Author

deparkes commented Oct 2, 2016

Cool. I think I could put something together.

On 1 October 2016 at 15:58, Jacob Tomlinson notifications@github.com
wrote:

This is great thanks. Do you think you could write a unit test which
exposes the bug?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#26 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC42jTjr1BCE6ELSQLlAle-sVWxcRjICks5qvnUHgaJpZM4KLuD8
.

@deparkes deparkes closed this Nov 15, 2016
@deparkes deparkes reopened this Nov 15, 2016
@deparkes
Copy link
Contributor Author

The unit test exposing the forecast.now() bug was failing in Travis CI for Python 2.6 - to fix this I've added a work-around to Forecast.py.

@jacobtomlinson jacobtomlinson merged commit dcb9730 into Perseudonymous:master Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants