Skip to content

Commit

Permalink
✅ remove obviated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma committed Oct 13, 2022
1 parent 4bbea76 commit 9c48630
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
19 changes: 0 additions & 19 deletions tests/sqlfluff_templater/linter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,6 @@
) # noqa: F401


@pytest.mark.parametrize("path", ["models/my_new_project/disabled_model.sql", "macros/echo.sql"])
@pytest.mark.skip(
reason="We don't need to exclude disabled models since models aren't relevant in our implementation, we lint SQL strings"
)
def test__linter__skip_file(path, project_dir): # noqa
"""Test that the linter skips disabled dbt models and macros."""
conf = FluffConfig(configs=DBT_FLUFF_CONFIG)
lntr = Linter(config=conf)
model_file_path = os.path.join(project_dir, path)
linted_path = lntr.lint_path(path=model_file_path)
# Check that the file is still there
assert len(linted_path.files) == 1
linted_file = linted_path.files[0]
# Normalise paths to control for OS variance
assert os.path.normpath(linted_file.path) == os.path.normpath(model_file_path)
assert not linted_file.templated_file
assert not linted_file.tree


def test__linter__lint_ephemeral_3_level(project_dir): # noqa
"""Test linter can lint a project with 3-level ephemeral dependencies."""
# This was previously crashing inside dbt, in a function named
Expand Down
26 changes: 0 additions & 26 deletions tests/sqlfluff_templater/templater_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,32 +159,6 @@ def test__templater_dbt_templating_test_lex(project_dir, dbt_templater, fname):
assert templated_file.templated_str == "select a\nfrom table_a" + "\n" * n_trailing_newlines


@pytest.mark.parametrize(
"path,reason",
[
(
"models/my_new_project/disabled_model.sql",
"it is disabled",
),
(
"macros/echo.sql",
"it is a macro",
),
],
)
@pytest.mark.skip(
reason="We don't need to exclude disabled models since models aren't relevant in our implementation, we lint SQL strings"
)
def test__templater_dbt_skips_file(path, reason, dbt_templater, project_dir): # noqa: F811
"""A disabled dbt model should be skipped."""
with pytest.raises(SQLFluffSkipFile, match=reason):
dbt_templater.process(
in_str=None,
fname=os.path.join(project_dir, path),
config=FluffConfig(configs=DBT_FLUFF_CONFIG),
)


@pytest.mark.parametrize(
"fname",
[
Expand Down

0 comments on commit 9c48630

Please sign in to comment.