Skip to content

Commit ae686fa

Browse files
committed
chore: Fix linting checks
1 parent 7d257d4 commit ae686fa

18 files changed

+45
-30
lines changed

docs/conf.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
# Configuration file for the Sphinx documentation builder.
2-
#
3-
# This file only contains a selection of the most common options. For a full
4-
# list see the documentation:
5-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6-
7-
# -- Path setup --------------------------------------------------------------
8-
9-
# If extensions (or modules to document with autodoc) are in another directory,
10-
# add these directories to sys.path here. If the directory is relative to the
11-
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
1+
"""Configuration file for the Sphinx documentation builder."""
132
import os
143
import sys
154

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ def test_files(tmp_path_factory, dbt_project_file):
582582

583583

584584
def pytest_addoption(parser):
585+
"""Adds option to run integration tests with pytest."""
585586
parser.addoption(
586587
"--run-integration",
587588
action="store_true",
@@ -591,6 +592,7 @@ def pytest_addoption(parser):
591592

592593

593594
def pytest_collection_modifyitems(config, items):
595+
"""Allows skipping integration tests when flag missing."""
594596
if config.getoption("--run-integration"):
595597
return
596598

tests/dags/test_dbt_dags.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ def target_connection_dag(
304304
generic_tests_files,
305305
):
306306
"""Create a testing DAG that utilizes Airflow connections."""
307-
308307
with DAG(
309308
dag_id="target_conn_dbt_dag",
310309
start_date=DATA_INTERVAL_START,

tests/hooks/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""This module contains all dbt hook tests.
2+
3+
DbtHook tests can be found under the dbt submodule.
4+
"""

tests/hooks/dbt/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""This module contains all DbtHook tests, one test suite per command."""

tests/hooks/dbt/test_dbt_compile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def test_dbt_compile_non_existent_model(
1919

2020
@pytest.fixture(scope="function")
2121
def compile_dir(dbt_project_file):
22+
"""Return the path to a directory with dbt compiled files."""
2223
import shutil
2324

2425
compile_dir = dbt_project_file.parent / "target"

tests/hooks/dbt/test_dbt_hook_base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,18 @@ def test_dbt_hook_get_remote_raises_not_implemented():
7373

7474

7575
class FakeRemote:
76+
"""A fake dbt remote that simply returns arguments used in mocking."""
77+
7678
def download_dbt_profiles(self, *args, **kwargs):
79+
"""Fakes the download_dbt_profiles method."""
7780
return (args, kwargs)
7881

7982
def upload_dbt_project(self, *args, **kwargs):
83+
"""Fakes the upload_dbt_project method."""
8084
return (args, kwargs)
8185

8286
def download_dbt_project(self, *args, **kwargs):
87+
"""Fakes the download_dbt_project method."""
8388
return (args, kwargs)
8489

8590

tests/hooks/dbt/test_dbt_run.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Unit test module for running dbt run with the DbtHook."""
2-
import os
32
from pathlib import Path
43

54
import pytest
@@ -119,7 +118,7 @@ def test_dbt_run_task_exclude_one_file(
119118
def test_dbt_run_fails_with_non_existent_project(hook, profiles_file, dbt_project_file):
120119
"""Test what exception is raised when running from a fake project."""
121120
with pytest.raises(AirflowException):
122-
result = hook.run_dbt_task(
121+
hook.run_dbt_task(
123122
"run",
124123
project_dir="/home/fake/project",
125124
profiles_dir="/home/fake/profiles/",

tests/hooks/test_s3_hook.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,10 @@ def test_upload_dbt_project_with_partial_replace(
354354
s3_bucket, s3_hook, tmpdir, test_files
355355
):
356356
"""Test pushing a dbt project to a S3 path with replace = False.
357-
For this test we are looking for one file to be pushed while the rest are to be ignored
358-
as they already exist and we are running with replace = False.
357+
358+
For this test we are looking for one file to be pushed while the rest are to be
359+
ignored as they already exist and we are running with replace = False.
359360
"""
360-
prefix = f"s3://{s3_bucket}/project/"
361361
bucket = s3_hook.get_bucket(s3_bucket)
362362

363363
last_modified_expected = {}
@@ -390,7 +390,7 @@ def test_upload_dbt_project_with_partial_replace(
390390
remote = DbtS3RemoteHook()
391391
with freezegun.freeze_time("2022-02-02"):
392392
# Attempt to push project a month after.
393-
# Only one file should be pushed as the rest exist and we are passing replace = False.
393+
# Only one file should be pushed as the rest exist and we using replace = False.
394394
remote.upload_dbt_project(
395395
project_dir, f"s3://{s3_bucket}/project/", replace=False
396396
)

tests/operators/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""This module contains all dbt operator tests."""

0 commit comments

Comments
 (0)