pysal / region

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

pytest raises an error when in fact the test only warns #7

Closed ljwolf closed 6 years ago

ljwolf commented 6 years ago

the SKATER implementation raises a warning when the number of subtrees found is smaller than the number requested. This warning is informative, and lets the user know how they might modify their call to get the number of regions they want: reducing the quorum option.

This warning is always raised when n_clusters = np.inf, since you can never find an infinite number of disjoint subtrees in a finite graph.

pytest decides the unittest has failed when it's only been warned.

FIX We need to figure out how to get pytest to allow warnings in the tests, or just let the warning through in this test.

I would like to keep the warning rather than the error or simply a silent but surprising return.

ljwolf commented 6 years ago

fixed by #40