Skip to content

Commit

Permalink
fix: Refurb FURB149 & FURB184 compliance (#62)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
davidjrice and dependabot[bot] authored Mar 31, 2024
1 parent 0cf2755 commit 4844c88
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dev = [
"black==23.11.0",
"codespell==2.2.6",
"refurb==1.24.0",
"ruff==0.1.6",
"ruff==0.3.1",
"tox==4.11.3",
"types-toml==0.10.8.7",
]
Expand Down
6 changes: 3 additions & 3 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ def test_should_parse_library_config_with_src_directory() -> None:
config = Config.parse("fixtures/library_src")
assert config.source_directories == ["src"]
assert config.test_directory == "tests"
assert config.include_source_dir_in_test_path is False
assert not config.include_source_dir_in_test_path


def test_should_parse_library_config_with_package_directory() -> None:
config = Config.parse("fixtures/library_pkg")
assert config.source_directories == ["package"]
assert config.test_directory == "tests"
assert config.include_source_dir_in_test_path is True
assert config.include_source_dir_in_test_path


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


def test_ignore_pattern() -> None:
Expand Down
13 changes: 7 additions & 6 deletions tests/test_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ def test_execute_source_file_strategy(mock_run: MagicMock) -> None:
test_directory=autotest.config.test_directory,
)

strategy = SourceFileStrategy(source_file)
result = strategy.execute()
result = SourceFileStrategy(source_file).execute()

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

path = Path("fixtures/application/tests/test_module.py").absolute()
path = path.relative_to(autotest.config.path.absolute())
path = (
Path("fixtures/application/tests/test_module.py")
.absolute()
.relative_to(autotest.config.path.absolute())
)

strategy = TestFileStrategy(path)
result = strategy.execute()
result = TestFileStrategy(path).execute()

assert result
mock_run.assert_has_calls(
Expand Down

0 comments on commit 4844c88

Please sign in to comment.