mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
* Discontinue Python 2. See #219 * Remove Python 2 config option * Remove coerce_native * Remove PY2 variable * s/text_type/str/g * Flake8 fixes * Remove str = str * s/to_native/to_unicode/g * Remove to_unicode = to_unicode * Remove iteritems * Remove itervalues * Remove str import, flake8 fixes * Remove urlparse compat code * Remove with_metaclass * Remove unused PY2 variable * Remove getargspec_ish * Remove to_bytes * Remove compat module * Remove Python 2 from Travis * fixup! Remove urlparse compat code * fixup! Remove urlparse compat code * fixup! Remove compat module
41 lines
876 B
Python
41 lines
876 B
Python
# -*- coding: utf-8 -*-
|
|
'''
|
|
General-purpose fixtures for vdirsyncer's testsuite.
|
|
'''
|
|
import logging
|
|
import os
|
|
|
|
import click_log
|
|
|
|
from hypothesis import HealthCheck, Verbosity, settings
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def setup_logging():
|
|
click_log.basic_config('vdirsyncer').setLevel(logging.DEBUG)
|
|
|
|
|
|
try:
|
|
import pytest_benchmark
|
|
except ImportError:
|
|
@pytest.fixture
|
|
def benchmark():
|
|
return lambda x: x()
|
|
else:
|
|
del pytest_benchmark
|
|
|
|
settings.register_profile("ci", settings(
|
|
max_examples=1000,
|
|
verbosity=Verbosity.verbose,
|
|
suppress_health_check=[HealthCheck.too_slow]
|
|
))
|
|
settings.register_profile("deterministic", settings(
|
|
derandomize=True,
|
|
))
|
|
|
|
if os.environ['DETERMINISTIC_TESTS'].lower() == 'true':
|
|
settings.load_profile("deterministic")
|
|
elif os.environ['CI'].lower() == 'true':
|
|
settings.load_profile("ci")
|