ovalhub / pyicu

The PyICU project repository has moved to https://pyicu.org.
Other
133 stars 49 forks source link

testLocaleMatcher not skipped on old ICU when run via pytest #120

Closed mkszuba closed 4 years ago

mkszuba commented 4 years ago

Although testLocaleMatcher does check if the underlying ICU version is at least 65.0 before proceeding, it only only seems to do so when the script in question is run directly. As a result, when I attempted to run the test suite from the upcoming Gentoo ebuild for 2.4.2 on a system with ICU-64.2, which ebuilds call pytest on the unit-test directory rather than invoke individual scripts, I saw errors. The attached patch solves the problem for me. It may or may not make the original version check unnecessary, I haven't tried. pyicu-2.4.2-testLocaleMatcher_pytest_old_icu.txt

ovalhub commented 4 years ago

I believe I fixed all these issues in HEAD when we setup travis CI a few weeks ago (but I haven't looked at your patch yet)

On Dec 19, 2019, at 14:11, Marek Szuba notifications@github.com wrote:

Although testLocaleMatcher does check if the underlying ICU version is at least 65.0 before proceeding, it only only seems to do so when the script in question is run directly. As a result, when I attempted to run the test suite from the upcoming Gentoo ebuild for 2.4.2 on a system with ICU-64.2, which ebuilds call pytest on the unit-test directory rather than invoke individual scripts, I saw errors. The attached patch solves the problem for me. It may or may not make the original version check unnecessary, I haven't tried. pyicu-2.4.2-testLocaleMatcher_pytest_old_icu.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mkszuba commented 4 years ago

Indeed fixed on master (d'oh, should have looked there too), except you have done it by implementing the skip in unittest-compatible fashion by placing in the set-up method whereas my patch uses a pytest annotator (skipif). Seeing as pytest is explicitly mentioned in listed as a test dependency in setup.py, one might wonder stick with the former approach - but in the end, whatever works!