Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation.  All rights reserved.
# Licensed under the MIT License.  See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""Configuration for pytest."""
 
import pytest
 
 
def pytest_configure(config):
    config.addinivalue_line("markers", "slow: mark test as slow to run")
    # Suppress PyTorch TorchScript-based ONNX export deprecation warnings.
    # These come from torch.onnx.export when using the legacy exporter (dynamo=False).
    config.addinivalue_line(
        "filterwarnings",
        "ignore:You are using the legacy TorchScript-based ONNX export:DeprecationWarning",
    )
    config.addinivalue_line(
        "filterwarnings",
        "ignore:The feature will be removed:DeprecationWarning",
    )
    # Suppress TracerWarnings from PyTorch tracing (expected when tracing models with data-dependent control flow)
    config.addinivalue_line(
        "filterwarnings",
        "ignore::torch.jit.TracerWarning",
    )
    # Suppress UserWarning about dynamic axes validation from torch.onnx
    config.addinivalue_line(
        "filterwarnings",
        "ignore:Provided key .* for dynamic axes is not a valid input/output name:UserWarning",
    )
    # Suppress UserWarning about ONNX inplace ops removal
    config.addinivalue_line(
        "filterwarnings",
        "ignore:ONNX Preprocess - Removing mutation from node:UserWarning",
    )
    # Suppress UserWarning about creating tensor from list of numpy ndarrays
    config.addinivalue_line(
        "filterwarnings",
        "ignore:Creating a tensor from a list of numpy.ndarrays:UserWarning",
    )
 
 
def pytest_addoption(parser):
    parser.addoption("--slow", action="store_true", default=False, help="run slow tests")
 
 
def pytest_collection_modifyitems(config, items):
    if config.getoption("--slow"):
        # --slow given: do not skip slow tests
        return
    skip_slow = pytest.mark.skip(reason="need --slow option to run")
    for item in items:
        if "slow" in item.keywords:
            item.add_marker(skip_slow)