8000 fix(pytest_plugin,tests): Import DoctestItem deeper · vcs-python/libvcs@f6b88f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit f6b88f4

Browse files
committed
fix(pytest_plugin,tests): Import DoctestItem deeper
1 parent 61cc16d commit f6b88f4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libvcs/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
import pytest
55

6-
from _pytest.doctest import DoctestItem
7-
86

97
@pytest.fixture(autouse=True)
108
def add_doctest_fixtures(
119
request: pytest.FixtureRequest,
1210
doctest_namespace: t.Dict[str, t.Any],
1311
) -> None:
12+
from _pytest.doctest import DoctestItem
13+
1414
if isinstance(request._pyfuncitem, DoctestItem):
1515
request.getfixturevalue("add_doctest_fixtures")
1616
request.getfixturevalue("set_home")

src/libvcs/pytest_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
import pytest
1111

12-
from _pytest.doctest import DoctestItem
13-
1412
from libvcs._internal.run import run
1513
from libvcs.sync.git import GitRemote, GitSync
1614
from libvcs.sync.hg import HgSync
@@ -419,6 +417,8 @@ def add_doctest_fixtures(
419417
create_hg_remote_repo: CreateProjectCallbackFixtureProtocol,
420418
git_repo: pathlib.Path,
421419
) -> None:
420+
from _pytest.doctest import DoctestItem
421+
422422
if not isinstance(request._pyfuncitem, DoctestItem): # Only run on doctest items
423423
return
424424
doctest_namespace["tmp_path"] = tmp_path

0 commit comments

Comments
 (0)
0