Skip to content

Commit

Permalink
🧪 updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juftin committed Feb 8, 2024
1 parent ef58c28 commit 71f125e
Show file tree
Hide file tree
Showing 5 changed files with 363 additions and 352 deletions.
696 changes: 348 additions & 348 deletions tests/__snapshots__/test_screenshots.ambr

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pathlib
from typing import Any, Dict, List

import pyperclip
import pytest
from click.testing import CliRunner
from textual_universal_directorytree import GitHubPath
Expand Down Expand Up @@ -44,6 +45,16 @@ def github_release_path() -> GitHubPath:
return GitHubPath(uri)


@pytest.fixture(autouse=True)
def copy_supported(monkeypatch: pytest.MonkeyPatch) -> None:
"""
Override _copy_supported
"""
monkeypatch.setattr(
pyperclip, "determine_clipboard", lambda: (lambda: True, lambda: True)
)


@pytest.fixture(scope="module")
def vcr_config() -> Dict[str, List[Any]]:
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from click.testing import CliRunner

from browsr._cli import browsr
from browsr.cli import browsr


def test_cli_main(runner: CliRunner) -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from textual_universal_directorytree import GitHubPath

from browsr._base import TextualAppContext
from browsr._config import favorite_themes
from browsr.base import TextualAppContext
from browsr.config import favorite_themes
from tests.conftest import cassette


Expand Down
2 changes: 1 addition & 1 deletion tests/test_screenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
def app_file() -> str:
file_content = """
from browsr import Browsr
from browsr._base import TextualAppContext
from browsr.base import TextualAppContext
file_path = "{file_path}"
context = TextualAppContext(file_path=file_path)
Expand Down

0 comments on commit 71f125e

Please sign in to comment.