Skip to content

Commit 4844c88

Browse files
fix: Refurb FURB149 & FURB184 compliance (#62)
* build(deps-dev): bump ruff from 0.1.6 to 0.3.1 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.1.6 to 0.3.1. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](astral-sh/ruff@v0.1.6...v0.3.1) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * fix: refurb rule FURB149 compliance * fix: FURB184 compliance * fix: FURB184 compliance * fix: black formatting error --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 0cf2755 commit 4844c88

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dev = [
2525
"black==23.11.0",
2626
"codespell==2.2.6",
2727
"refurb==1.24.0",
28-
"ruff==0.1.6",
28+
"ruff==0.3.1",
2929
"tox==4.11.3",
3030
"types-toml==0.10.8.7",
3131
]

tests/test_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ def test_should_parse_library_config_with_src_directory() -> None:
55
config = Config.parse("fixtures/library_src")
66
assert config.source_directories == ["src"]
77
assert config.test_directory == "tests"
8-
assert config.include_source_dir_in_test_path is False
8+
assert not config.include_source_dir_in_test_path
99

1010

1111
def test_should_parse_library_config_with_package_directory() -> None:
1212
config = Config.parse("fixtures/library_pkg")
1313
assert config.source_directories == ["package"]
1414
assert config.test_directory == "tests"
15-
assert config.include_source_dir_in_test_path is True
15+
assert config.include_source_dir_in_test_path
1616

1717

1818
def test_should_parse_application_config() -> None:
1919
config = Config.parse("fixtures/application")
2020
assert config.source_directories == ["app", "lib"]
2121
assert config.test_directory == "tests"
22-
assert config.include_source_dir_in_test_path is True
22+
assert config.include_source_dir_in_test_path
2323

2424

2525
def test_ignore_pattern() -> None:

tests/test_strategy.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ def test_execute_source_file_strategy(mock_run: MagicMock) -> None:
1616
test_directory=autotest.config.test_directory,
1717
)
1818

19-
strategy = SourceFileStrategy(source_file)
20-
result = strategy.execute()
19+
result = SourceFileStrategy(source_file).execute()
2120

2221
assert result
2322
mock_run.assert_has_calls(
@@ -33,11 +32,13 @@ def test_execute_test_file_strategy(mock_run: MagicMock) -> None:
3332
mock_run.return_value = 0
3433
autotest = Autotest("fixtures/application")
3534

36-
path = Path("fixtures/application/tests/test_module.py").absolute()
37-
path = path.relative_to(autotest.config.path.absolute())
35+
path = (
36+
Path("fixtures/application/tests/test_module.py")
37+
.absolute()
38+
.relative_to(autotest.config.path.absolute())
39+
)
3840

39-
strategy = TestFileStrategy(path)
40-
result = strategy.execute()
41+
result = TestFileStrategy(path).execute()
4142

4243
assert result
4344
mock_run.assert_has_calls(

0 commit comments

Comments
 (0)