pysal / region

A library for Spatially-Explicit Regionalization
BSD 3-Clause "New" or "Revised" License
14 stars 16 forks source link

A fix for travis pytest (gives error when warning) without changing pytest configuration #8

Closed weikang9009 closed 6 years ago

weikang9009 commented 6 years ago

It turns out that the travis-ci build with pytest exits with code 1 (fail) when there is a warning with skater is due to warnings.filterwarnings("error") in test_heu.py which turns warnings into exceptions. Once the line is commented out, the travis-ci build with pytest will be successful and give a warning message: image Not sure why the warning filter becomes a global one though...

I also changed the testing code for skater test_skater.py to use the pytest package and syntax instead of unittest to be consistent with the others in the region package.

ljwolf commented 6 years ago

Oh! I didn't see that when I was troubleshooting this; I just figured pytest threw errors on all warnings, so filtered that specific warning we knew about.

I'm not sure why @yogabonito wanted to have warnings be exceptions in test_heu.py... is there a good reason there?

Maybe the proper fix is to turn warnings-as-failures back off after that code, rather than forcing them always to be off.

weikang9009 commented 6 years ago

That might work. Let's give it a try!

ljwolf commented 6 years ago

o, maybe also rebase? git pull --rebase upstream master, if you called this one origin?

weikang9009 commented 6 years ago

I think I have integrated all the updates from the master branch. No?

ljwolf commented 6 years ago

it says "this branch cannot be rebased due to conflicts?" not sure why that'd happen if the rebase was successful?

weikang9009 commented 6 years ago

I didn't use --rebase when pulling changes from upstream master... 😢

On Tue, May 8, 2018 at 3:07 PM Levi John Wolf notifications@github.com wrote:

it says "this branch cannot be rebased due to conflicts?" not sure why that'd happen if the rebase was successful?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pysal/region/pull/8#issuecomment-387557876, or mute the thread https://github.com/notifications/unsubscribe-auth/AHBLNEJ2hHLXnLGM4Um6KJHpc1qGRWEYks5twhc9gaJpZM4T3Pvf .

-- Wei Kang School of Geographical Sciences & Urban Planning Arizona State University | Ph.D. Candidate

ljwolf commented 6 years ago

oh no... ok, well, we could:

  1. obliterate, change, & force push. this would reset the repo you have locally to the state it's on in master, so don't do this if that's too much to delete/reset. git fetch upstream master && git reset --hard upstream/master, make the changes again, and git push -f origin master (or replace origin with whatever you've called your own remote version). Then, this PR will automatically update with the right stuff.
  2. open a new PR with the changes on top of master & close this one?

I've done number 1, but it's pretty spooky :ghost:

yogabonito commented 6 years ago

Thank you very much, @weikang9009 for finding the root of the errors! And sorry, @ljwolf, for causing so much headache! Honestly, I don't remember why I wrote that warnings2errors-line (I even forgot that I used it).