File: conftest.py

package info (click to toggle)
python-azure 20251118%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 783,356 kB
  • sloc: python: 6,474,533; ansic: 804; javascript: 287; sh: 205; makefile: 198; xml: 109
file content (24 lines) | stat: -rw-r--r-- 995 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pytest
from devtools_testutils import (
    add_general_string_sanitizer,
    test_proxy,
    add_oauth_response_sanitizer,
    set_custom_default_matcher,
)


# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method
@pytest.fixture(scope="session", autouse=True)
def start_proxy(test_proxy):
    add_general_string_sanitizer(target="sharedwus", value="fakeresource")
    add_general_string_sanitizer(target="policies/SgxEnclave:reset", value="policies/Tpm:reset")
    add_general_string_sanitizer(target="policies/OpenEnclave:reset", value="policies/Tpm:reset")
    add_general_string_sanitizer(target="policies/SgxEnclave", value="policies/Tpm")
    add_general_string_sanitizer(target="policies/OpenEnclave", value="policies/Tpm")
    add_oauth_response_sanitizer()
    return


@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
    set_custom_default_matcher(ignored_query_parameters=["api-version"])