summaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2022-12-08 08:55:54 -0500
committerMike Frysinger <vapier@google.com>2022-12-08 22:22:39 +0000
commite81528649236ec9fb5983191767a96dc30acff54 (patch)
tree74b288fe316d673595a8eaf56e5270d4d41b224f /tests/conftest.py
parent0ab6b1168811586b62d8d1c26bad118b0a4b3807 (diff)
downloadgit-repo-e81528649236ec9fb5983191767a96dc30acff54.tar.gz
tests: clean up repo_trace._TRACE_FILE patching
Patch this automatically for all tests rather than duplicating the boilerplate in diff testcases. Change-Id: I391d5c859974cda3d5680d34ede2ce6e9e925838 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/354358 Reviewed-by: Joanna Wang <jojwang@google.com> Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
new file mode 100644
index 00000000..3e43f6d3
--- /dev/null
+++ b/tests/conftest.py
@@ -0,0 +1,25 @@
1# Copyright 2022 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15"""Common fixtures for pytests."""
16
17import pytest
18
19import repo_trace
20
21
22@pytest.fixture(autouse=True)
23def disable_repo_trace(tmp_path):
24 """Set an environment marker to relax certain strict checks for test code."""
25 repo_trace._TRACE_FILE = str(tmp_path / 'TRACE_FILE_from_test')