File: conftest.py

package info (click to toggle)
mpmath 1.4.0~b4-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,548 kB
  • sloc: python: 47,699; makefile: 22
file content (32 lines) | stat: -rw-r--r-- 739 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
import sys

import pytest

import mpmath


collect_ignore = ['mpmath/__init__.py',
                  'mpmath/rational.py', 'mpmath/math2.py']


def pytest_report_header(config):
    print("mpmath backend: %s" % mpmath.libmp.backend.BACKEND)
    print("mpmath mp class: %s" % repr(mpmath.mp))
    print("mpmath version: %s" % mpmath.__version__)
    print("Python version: %s" % sys.version)


def pytest_configure(config):
    config.addinivalue_line('markers', 'slow: marks tests as slow')


@pytest.fixture(autouse=True)
def reset_mp_globals():
    from mpmath import mp, iv
    mp.prec = sys.float_info.mant_dig
    mp.pretty = False
    mp.rounding = 'n'
    mp.pretty_dps = "str"
    iv.prec = mp.prec
    iv.pretty = False