ecmwf / eccodes-python

Python interface to the ecCodes GRIB/BUFR decoder/encoder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failing tests due to missing sample file.

jdkloe opened this issue · comments

After downloading eccodes-1.5.0.tar.gz from pypi it builds and installs just fine. But when I try to execute the tests using pytest-3 I get the following 5 test failures:

================================ short test summary info =================================
FAILED tests/test_eccodes.py::test_count_in_file - FileNotFoundError: [Errno 2] No such...
FAILED tests/test_highlevel.py::test_message_iter - FileNotFoundError: [Errno 2] No suc...
FAILED tests/test_highlevel.py::test_message_iter_missingvalues - FileNotFoundError: [E...
FAILED tests/test_highlevel.py::test_message_copy - FileNotFoundError: [Errno 2] No suc...
FAILED tests/test_highlevel.py::test_write_message - FileNotFoundError: [Errno 2] No su...
======================== 5 failed, 65 passed, 4 warnings in 2.30s ========================

After inspecting this, it becomes clear that this is caused by a missing sample file. The tests expect the file era5-levels-members.grib to be present in the tests/sample-data folder but that file is missing.
This in turn is due to a small bug in the MANIFEST.in file, which includes *.grib2 but not *.grib from the tests folder.
This is confirmed by manually downloading the file era5-levels-members.grib and placing it in the tests/sample-data folder. After doing this all tests run just fine.

The file "era5-levels-members.grib" should have been included in the MANIFEST.in
I will fix this in the next release
Many thanks