HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/astropy/io/ascii/tests/common.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst

import os

import numpy as np

__all__ = [
    "assert_equal",
    "assert_almost_equal",
    "assert_true",
    "setup_function",
    "teardown_function",
]

CWD = os.getcwd()
TEST_DIR = os.path.dirname(__file__)


def setup_function(function):
    os.chdir(TEST_DIR)


def teardown_function(function):
    os.chdir(CWD)


# Compatibility functions to convert from nose to pytest
def assert_equal(a, b):
    assert a == b


def assert_almost_equal(a, b, **kwargs):
    assert np.allclose(a, b, **kwargs)


def assert_true(a):
    assert a