Completed
Pull Request — master (#372)
by
unknown
01:41
created

test_axvline()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
1
# Copyright (c) 2017 MetPy Developers.
2
# Distributed under the terms of the BSD 3-Clause License.
3
# SPDX-License-Identifier: BSD-3-Clause
4
r"""Tests the operation of MetPy's unit support code."""
5
6
import matplotlib.pyplot as plt
7
import pytest
8
9
from metpy.testing import set_agg_backend  # noqa: F401
10
from metpy.units import units
11
12
13
@pytest.mark.mpl_image_compare(tolerance=0, remove_text=True)
14
def test_axhline():
15
    r"""Ensure that passing a quantity to axhline does not error."""
16
    fig, ax = plt.subplots()
17
    ax.axhline(930 * units('mbar'))
18
    ax.set_ylim(900, 950)
19
    return fig
20
21
22
@pytest.mark.mpl_image_compare(tolerance=0, remove_text=True)
23
def test_axvline():
24
    r"""Ensure that passing a quantity to axvline does not error."""
25
    fig, ax = plt.subplots()
26
    ax.axvline(0 * units('degC'))
27
    ax.set_xlim(-1, 1)
28
    return fig
29