Skip to content

Commit

Permalink
Move Run type alias to conftest
Browse files Browse the repository at this point in the history
It's only used in tests
  • Loading branch information
ihabunek committed Jan 1, 2024
1 parent 84e7534 commit 3a147a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 5 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
"""

import json
import re
import os
import psycopg2
import pytest
import re
import typing as t
import uuid

from click.testing import CliRunner, Result
Expand All @@ -31,6 +32,9 @@ def pytest_configure(config):
toot.settings.DISABLE_SETTINGS = True


# Type alias for run commands
Run = t.Callable[..., Result]

# Mastodon database name, used to confirm user registration without having to click the link
DATABASE_DSN = os.getenv("TOOT_TEST_DATABASE_DSN")
TOOT_TEST_BASE_URL = os.getenv("TOOT_TEST_BASE_URL")
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from unittest.mock import MagicMock

from toot import User, cli
from toot.cli import Run
from tests.integration.conftest import Run

# TODO: figure out how to test login

Expand Down
4 changes: 0 additions & 4 deletions toot/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
seconds" or any combination of above. Shorthand: "1d", "2h30m", "5m30s\""""


# Type alias for run commands
Run = t.Callable[..., Result]


def get_default_visibility() -> str:
return os.getenv("TOOT_POST_VISIBILITY", "public")

Expand Down

0 comments on commit 3a147a5

Please sign in to comment.