# Copyright 2023 The HuggingFace Team. All rights reserved.1#2# Licensed under the Apache License, Version 2.0 (the "License");3# you may not use this file except in compliance with the License.4# You may obtain a copy of the License at5#6# http://www.apache.org/licenses/LICENSE-2.07#8# Unless required by applicable law or agreed to in writing, software9# distributed under the License is distributed on an "AS IS" BASIS,10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11# See the License for the specific language governing permissions and12# limitations under the License.1314# tests directory-specific settings - this file is run automatically15# by pytest before any tests are run1617import sys18import warnings19from os.path import abspath, dirname, join202122# allow having multiple repository checkouts and not needing to remember to rerun23# 'pip install -e .[dev]' when switching between checkouts and running tests.24git_repo_path = abspath(join(dirname(dirname(dirname(__file__))), "src"))25sys.path.insert(1, git_repo_path)262728# silence FutureWarning warnings in tests since often we can't act on them until29# they become normal warnings - i.e. the tests still need to test the current functionality30warnings.simplefilter(action="ignore", category=FutureWarning)313233def pytest_addoption(parser):34from diffusers.utils.testing_utils import pytest_addoption_shared3536pytest_addoption_shared(parser)373839def pytest_terminal_summary(terminalreporter):40from diffusers.utils.testing_utils import pytest_terminal_summary_main4142make_reports = terminalreporter.config.getoption("--make-reports")43if make_reports:44pytest_terminal_summary_main(terminalreporter, id=make_reports)454647