Skip to content

Commit

Permalink
Rename test/fixtures/parser directory to test/fixtures/dialects (sqlf…
Browse files Browse the repository at this point in the history
…luff#1585)

* Rename test/fixtures/parser to dialects

* Rename

* Revert keyword change

Co-authored-by: Alan Cruickshank <alanmcruickshank@gmail.com>
  • Loading branch information
2 people authored and ttomasz committed Oct 12, 2021
1 parent 29196fa commit 74038c3
Show file tree
Hide file tree
Showing 1,174 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _If there is an open issue for this, then please include `fixes #XXXX` or `close

- Included test cases to demonstrate any code changes, which may be one or more of the following:
- `.yml` rule test cases in `test/fixtures/rules/std_rule_cases`.
- `.sql`/`.yml` parser test cases in `test/fixtures/parser` (note YML files can be auto generated with `python test/generate_parse_fixture_yml.py` or by running `tox` locally).
- `.sql`/`.yml` parser test cases in `test/fixtures/dialects` (note YML files can be auto generated with `python test/generate_parse_fixture_yml.py` or by running `tox` locally).
- Full autofix test cases in `test/fixtures/linter/autofix`.
- Other.
- Added appropriate documentation for the change.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ To run the dbt-related tests you will have to explicitly include these tests:
tox -e cov-init,dbt018-py38,cov-report-dbt -- -m "dbt"
```

For more information on adding and running test cases see the [Parser Test README](test/fixtures/parser/README.md) and the [Rules Test README](test/fixtures/rules/std_rule_cases/README.md).
For more information on adding and running test cases see the [Parser Test README](test/fixtures/dialects/README.md) and the [Rules Test README](test/fixtures/rules/std_rule_cases/README.md).

### Documentation Website

Expand Down
6 changes: 3 additions & 3 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def get_parse_fixtures(fail_on_missing_yml=False):
parse_success_examples = []
parse_structure_examples = []
# Generate the filenames for each dialect from the parser test directory
for d in os.listdir(os.path.join("test", "fixtures", "parser")):
for d in os.listdir(os.path.join("test", "fixtures", "dialects")):
# Ignore documentation
if d.endswith(".md"):
continue
# assume that d is now the name of a dialect
dirlist = os.listdir(os.path.join("test", "fixtures", "parser", d))
dirlist = os.listdir(os.path.join("test", "fixtures", "dialects", d))
for f in dirlist:
has_yml = False
if f.endswith(".sql"):
Expand Down Expand Up @@ -63,7 +63,7 @@ def get_parse_fixtures(fail_on_missing_yml=False):

def make_dialect_path(dialect, fname):
"""Work out how to find paths given a dialect and a file name."""
return os.path.join("test", "fixtures", "parser", dialect, fname)
return os.path.join("test", "fixtures", "dialects", dialect, fname)


def load_file(dialect, fname):
Expand Down
2 changes: 1 addition & 1 deletion test/dialects/ansi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test__dialect__ansi_specific_segment_not_parse(raw, err_locations, caplog):
def test__dialect__ansi_is_whitespace():
"""Test proper tagging with is_whitespace."""
lnt = Linter()
with open("test/fixtures/parser/ansi/select_in_multiline_comment.sql") as f:
with open("test/fixtures/dialects/ansi/select_in_multiline_comment.sql") as f:
parsed = lnt.parse_string(f.read())
# Check all the segments that *should* be whitespace, ARE
for raw_seg in parsed.tree.iter_raw_seg():
Expand Down
2 changes: 1 addition & 1 deletion test/dialects/dialects_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test__dialect__base_parse_struct(
assert expected_hash == actual_hash, (
"Parse tree hash does not match. Please run "
"'python test/generate_parse_fixture_yml.py' to create YAML files "
"in test/fixtures/parser."
"in test/fixtures/dialects."
)
else:
assert parsed == res
4 changes: 2 additions & 2 deletions test/dialects/snowflake_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from sqlfluff.core.dialects import dialect_selector


# Deprecated: All new tests should be added as .sql and .yml files under `test/fixtures/parser/snowflake`.
# See test/fixtures/parser/README.md for more details.
# Deprecated: All new tests should be added as .sql and .yml files under `test/fixtures/dialects/snowflake`.
# See test/fixtures/dialects/README.md for more details.
@pytest.mark.parametrize(
"segment_cls,raw",
[
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 74038c3

Please sign in to comment.