File: conftest.py

package info (click to toggle)
pygrib 2.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,444 kB
  • sloc: javascript: 1,365; python: 1,356; makefile: 39; ansic: 13
file content (20 lines) | stat: -rw-r--r-- 422 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Useful for testing."""
# stdlib
import os

# 3rd Party Import
import pytest

# Local
import pygrib


@pytest.fixture()
def samplegribfile(filename):
    """Open a grib file from the sampledata folder."""
    sampledir = os.path.join(
        os.path.dirname(os.path.abspath(__file__)),
        "../sampledata"
    )
    print(os.path.join(sampledir, filename))
    return pygrib.open(os.path.join(sampledir, filename))