Move Run type alias to conftest

It's only used in tests
This commit is contained in:
Ivan Habunek 2023-12-19 11:28:25 +01:00
parent 84e75347e0
commit 3a147a5ea0
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
3 changed files with 6 additions and 6 deletions

View File

@ -14,10 +14,11 @@ export TOOT_TEST_DATABASE_DSN="dbname=mastodon_development"
"""
import json
import re
import os
import psycopg2
import pytest
import re
import typing as t
import uuid
from click.testing import CliRunner, Result
@ -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")

View File

@ -3,7 +3,7 @@ from unittest import mock
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

View File

@ -39,10 +39,6 @@ DURATION_EXAMPLES = """e.g. "1 day", "2 hours 30 minutes", "5 minutes 30
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")