Skip to content

Commit 2a30747

Browse files
authored
fix tet filename pattern (#11)
1 parent fe60a4a commit 2a30747

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## [Unreleased]
44

5+
## [v1.0.7] - 2022-12-29
6+
7+
### Fixed
8+
9+
- Corrected default test filename regex to `test_.*\.py` from `test_.*.py`
10+
which previously did not correctly escape the `.` before the extension.
11+
512
## [v1.0.6] - 2022-12-28
613

714
### Fixed
@@ -30,3 +37,4 @@
3037
[v1.0.0]: https://github.com/jdkandersson/flake8-test-docs/releases/v1.0.0
3138
[v1.0.5]: https://github.com/jdkandersson/flake8-test-docs/releases/v1.0.5
3239
[v1.0.6]: https://github.com/jdkandersson/flake8-test-docs/releases/v1.0.6
40+
[v1.0.7]: https://github.com/jdkandersson/flake8-test-docs/releases/v1.0.7

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The plugin adds the following configurations to `flake8`:
5353
* `--test-docs-patter`: The pattern the test documentation should follow,
5454
e.g., `given/when/then`. Defaults to `arrange/act/assert`.
5555
* `--test-docs-filename-pattern`: The filename pattern for test files. Defaults
56-
to `test_.*.py`.
56+
to `test_.*\.py`.
5757
* `--test-docs-function-pattern`: The function pattern for test functions.
5858
Defaults to `test_.*`.
5959

flake8_test_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
TEST_DOCS_PATTERN_ARG_NAME = "--test-docs-pattern"
3131
TEST_DOCS_PATTERN_DEFAULT = "arrange/act/assert"
3232
TEST_DOCS_FILENAME_PATTERN_ARG_NAME = "--test-docs-filename-pattern"
33-
TEST_DOCS_FILENAME_PATTERN_DEFAULT = r"test_.*.py"
33+
TEST_DOCS_FILENAME_PATTERN_DEFAULT = r"test_.*\.py"
3434
TEST_DOCS_FUNCTION_PATTERN_ARG_NAME = "--test-docs-function-pattern"
3535
TEST_DOCS_FUNCTION_PATTERN_DEFAULT = r"test_.*"
3636
INDENT_SIZE_ARN_NAME = "--indent-size"

poetry.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "flake8-test-docs"
3-
version = "1.0.6"
3+
version = "1.0.7"
44
description = "A linter that checks test docstrings for the arrange/act/assert structure"
55
authors = ["David Andersson <[email protected]>"]
66
license = "Apache 2.0"

tests/test_flake8_test_docs_unit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ def test_plugin_invalid(code: str, expected_result: tuple[str, ...]):
811811
[
812812
pytest.param("test_.py", (f"2:0 {MISSING_MSG}",), id="test file"),
813813
pytest.param("file.py", (), id="not test file"),
814+
pytest.param("test_dpy", (), id="not test file missing ."),
814815
],
815816
)
816817
def test_plugin_filename(filename: str, expected_result: tuple[str, ...]):

0 commit comments

Comments
 (0)