-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix test failures in test_granules.py #61
Conversation
This is the remaining test failure: =================================== FAILURES ===================================
______________________ test_correct_granule_list_returned ______________________
def test_correct_granule_list_returned():
reg_a = ipd.Icesat2Data('ATL06',[-55, 68, -48, 71],['2019-02-20','2019-02-28'], version='2')
reg_a.avail_granules()
> obs_grans = [gran['producer_granule_id'] for gran in reg_a.granules]
E TypeError: 'Granules' object is not iterable
icepyx/tests/test_granules.py:407: TypeError Not sure if it's meant to test |
Ok, found out that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing those granules tests! icepyx underwent a large scale refactor about a month ago, so I haven't finished porting all of the tests over to the new structure (which is why not all of them are run yet).
I am aware that pytest will run all files that start with test. However, the CI is specifically set up in stages because different sets of tests are run under different circumstances. At the moment the second stage is disabled (see previous statement about the major refactor), but it will eventually be turned on again. Unfortunately, I had to merge the changes in this branch (which included a few bug fixes) before I got to where I wanted to be with the test updating because I needed them to be in master for the ongoing Hackweek and didn't have time to figure out which commits they were in. Maybe not the best practice, but I'm still learning and refining my own system as I go! If you could revert the changes to .travis.yml to keep the staged testing, then I will go ahead and merge this PR!
Ok, I've reverted the change (and changed the title too). But before you merge this, what I can do is to set travis up so that the first stage tests everything except Alternatively, we could put all the 'second stage' tests in a folder like As an aside, I found https://automationpanda.com/2017/03/06/python-testing-101-introduction/ to be a good resource for learning about testing when I first started (maybe check it out after the Hackweek), the |
@weiji14 I am fine with using the pytest Thanks for those resources - I look forward to checking them out when this crazy week is over! |
Should be using reg_a.granules.avail instead of reg_a.granules
Cool, I've used Great job on the Hackweek by the way, I've just been going over a few of the youtube videos and I can only imagine all the work going behind them to make everything go so smoothly! Definitely get some rest after, it's well deserved 😁 |
Yup - taking "test" out of the filename was very intentional until I got to updating it! Thanks for these changes and the kudos. The Hackweek went quite well, but I'm still catching up on everything that happened during it (or I missed because of it). : ) |
@weiji14 Don't forget to add yourself as a contributor on your next PR! |
Pytest automatically tests any files starting with the name
test_
, in folders undertests
, see https://docs.pytest.org/en/latest/example/pythoncollection.html. This means we don't need to explicitly add new tests to the.travis.yml
file everytime.TODO: