File: conftest.py

package info (click to toggle)
diff-cover 10.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,256 kB
  • sloc: python: 6,452; xml: 218; cpp: 18; sh: 12; makefile: 10
file content (17 lines) | stat: -rw-r--r-- 462 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pytest

from diff_cover.git_path import GitPathTool


@pytest.fixture(autouse=True)
def reset_git_path_tool():
    """Reset GitPathTool before each test to ensure test isolation.

    GitPathTool uses class variables (_cwd and _root) that persist across tests.
    This fixture ensures each test starts with a clean state.
    """
    GitPathTool._cwd = None
    GitPathTool._root = None
    yield
    GitPathTool._cwd = None
    GitPathTool._root = None