Skip to content

Commit

Permalink
Merge branch 'main' into feature/improve_programmatic_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
macpd committed Jun 18, 2024
2 parents 721f007 + a4c2b70 commit e16aac2
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Dockerfile-pytest-integration
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ RUN pip3 install --upgrade pip hatch
COPY README.md pyproject.toml conftest.py ./
# Copy source code
COPY ./src/ ./src/
COPY ./tests/ ./tests/

# Setup hatch env which will install deps
RUN hatch env create test

# Take arg for database URL, specified in docker-compose.yml
ARG DATABASE_URL
ENV DATABASE_URL=${DATABASE_URL:-}
ENTRYPOINT hatch --env test run pytest . -vv --database-url "$DATABASE_URL"
ENTRYPOINT hatch --env test run pytest tests/ -vv --database-url "$DATABASE_URL"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extra-dependencies = [
]

[tool.hatch.envs.test.scripts]
run = "pytest ./src -vv"
run = "pytest tests/ -vv"
postgres-integration-test-docker-as-sudo = [
"sudo docker compose build",
"sudo docker compose run postgres-integration-test",
Expand Down
Empty file added tests/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
CrawlTag,
upsert_videos,
)
from tiktok_api_helper.test_utils import (
from tests.test_utils import (
test_database_engine,
testdata_api_response_json,
all_videos,
all_crawls,
)

FAKE_SECRETS_YAML_FILE = Path("src/tiktok_api_helper/testdata/fake_secrets.yaml")
FAKE_SECRETS_YAML_FILE = Path("tests/testdata/fake_secrets.yaml")


@pytest.fixture
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/tiktok_api_helper/test_sql.py → tests/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
CrawlTag,
upsert_videos,
)
from tiktok_api_helper.test_utils import (
from tests.test_utils import (
test_database_engine,
testdata_api_response_json,
all_videos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_database_engine(database_url_command_line_arg) -> Engine:

@pytest.fixture
def testdata_api_response_json():
with open("src/tiktok_api_helper/testdata/api_response.json", "r") as f:
with open("tests/testdata/api_response.json", "r") as f:
return json.load(f)


Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit e16aac2

Please sign in to comment.