mirror of https://github.com/nucypher/nucypher.git
61 lines
1.7 KiB
Python
61 lines
1.7 KiB
Python
"""
|
|
This file is part of nucypher.
|
|
|
|
nucypher is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
nucypher is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with nucypher. If not, see <https://www.gnu.org/licenses/>.
|
|
"""
|
|
from twisted.logger import ILogObserver
|
|
from twisted.logger import globalLogPublisher
|
|
from zope.interface import provider
|
|
|
|
@provider(ILogObserver)
|
|
def simpleObserver(event):
|
|
print(event)
|
|
|
|
globalLogPublisher.addObserver(simpleObserver)
|
|
|
|
|
|
"""NOTICE: Depends on fixture modules; do not delete"""
|
|
from .fixtures import *
|
|
|
|
|
|
"""Pytest configuration"""
|
|
import pytest
|
|
|
|
|
|
def pytest_addoption(parser):
|
|
parser.addoption("--runslow",
|
|
action="store_true",
|
|
default=False,
|
|
help="run tests even if they are marked as slow")
|
|
|
|
|
|
def pytest_configure(config):
|
|
import sys
|
|
sys._pytest_is_running = True
|
|
|
|
|
|
def pytest_unconfigure(config):
|
|
import sys
|
|
del sys._pytest_is_running
|
|
|
|
|
|
def pytest_collection_modifyitems(config, items):
|
|
if config.getoption("--runslow"):
|
|
# --runslow given in cli: do not skip slow tests
|
|
return
|
|
skip_slow = pytest.mark.skip(reason="need --runslow option to run")
|
|
for item in items:
|
|
if "slow" in item.keywords:
|
|
item.add_marker(skip_slow)
|