File: test_testing_helpers.py

package info (click to toggle)
python-asdf 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,032 kB
  • sloc: python: 24,068; makefile: 123
file content (15 lines) | stat: -rw-r--r-- 389 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import warnings

import pytest


def test_warnings_are_errors():
    """
    Smoke test to make sure that warnings cause errors.
    This is here as previously asdf._tests._helpers had
    an ``assert_no_warnings`` function that was removed
    in favor of using a warning filter to turn warnings
    into errors.
    """
    with pytest.raises(UserWarning):
        warnings.warn("test")