Make ignoring relative paths possible by lagru · Pull Request #78 · scientific-python/docstub · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/docstub/_path_utils.py
20 changes: 20 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import os
from pathlib import Path

import pytest


@pytest.fixture
def tmp_path_cwd(tmp_path):
"""Fixture: Create temporary directory and use it as working directory.

.. warning::
Not written with parallelization in mind!
"""
previous_cwd = Path.cwd()
os.chdir(tmp_path)
try:
yield tmp_path
except:
os.chdir(previous_cwd)
raise
17 changes: 0 additions & 17 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Test command line interface."""

import logging
import os
from pathlib import Path

import pytest
Expand All @@ -13,22 +12,6 @@
PROJECT_ROOT = Path(__file__).parent.parent


@pytest.fixture
def tmp_path_cwd(tmp_path):
"""Fixture: Create temporary directory and use it as working directory.

.. warning::
Not written with parallelization in mind!
"""
previous_cwd = Path.cwd()
os.chdir(tmp_path)
try:
yield tmp_path
except:
os.chdir(previous_cwd)
raise


class Test_run:
def test_no_cache(self, tmp_path_cwd, caplog):
caplog.set_level(logging.INFO)
Expand Down
17 changes: 17 additions & 0 deletions tests/test_path_utils.py
Loading