Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ updates:
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 4
cooldown:
default-days: 7
open-pull-requests-limit: 1
groups:
all-github-actions:
applies-to: version-updates
patterns:
- "*"

# Maintain dependencies for poetry
- package-ecosystem: "pip"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/check-release-tag.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions .github/workflows/checks.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/dependency-update.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/fast-tests.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/matrix.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/report.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

## Summary

## Refactoring

* #1009: Fixed Sonar issues in test files
10 changes: 5 additions & 5 deletions test/unit/nox/_package_check_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def test_raises_non_zero_exist_with_readme_error(
package_readme.open(mode="a").write(not_closed_link_error)

# use of the folder with errors in the nox -s package:check function
with pytest.raises(CommandFailed) as e:
with patch(
"exasol.toolbox.nox._package.PROJECT_CONFIG",
new=test_project_config_factory(),
):
with patch(
"exasol.toolbox.nox._package.PROJECT_CONFIG",
new=test_project_config_factory(),
):
with pytest.raises(CommandFailed) as e:
package_check(nox_session)
# verify broken with non-zero exit status
assert str(e.value) == "Returned code 1"
2 changes: 1 addition & 1 deletion test/unit/nox/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ def nox_session_runner(tmp_path, nox_session_runner_posargs):
def nox_session(nox_session_runner):
# Extracted from nox testing
nox_session_runner.venv = make_fake_env(bin_paths=["/no/bin/for/you"])
yield Session(nox_session_runner)
return Session(nox_session_runner)
2 changes: 1 addition & 1 deletion test/unit/security_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def test_with_filled_input(sample_maven_vulnerabilities):
@staticmethod
def test_with_empty_input():
actual = set(security.from_maven("{}"))
assert len(actual) == 0
assert actual == set()


def test_format_jsonl():
Expand Down
14 changes: 6 additions & 8 deletions test/unit/util/dependencies/shared_models_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,11 @@ def test_works_as_expected():

@staticmethod
def test_raises_exception_when_latest_tag_not_found():
with pytest.raises(LatestTagNotFoundError):
with mock.patch.object(
Git,
"get_latest_tag",
side_effect=CalledProcessError(
cmd="Mocked subprocess error", returncode=1
),
):
with mock.patch.object(
Git,
"get_latest_tag",
side_effect=CalledProcessError(cmd="Mocked subprocess error", returncode=1),
):
with pytest.raises(LatestTagNotFoundError):
with poetry_files_from_latest_tag(root_path=PROJECT_CONFIG.root_path):
pass
22 changes: 11 additions & 11 deletions test/unit/util/release/changelog_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def expected_changes(
return changes


@pytest.fixture(scope="function")
@pytest.fixture
def changelog(tmp_path) -> Changelog:
changes_path = tmp_path / "doc/changes"
changes_path.mkdir(parents=True)
Expand All @@ -122,17 +122,17 @@ def changelog(tmp_path) -> Changelog:
)


@pytest.fixture(scope="function")
@pytest.fixture
def changelog_md(changelog):
changelog.changelog.write_text(SampleContent.old_changelog)


@pytest.fixture(scope="function")
@pytest.fixture
def unreleased_md(changelog):
changelog.unreleased.write_text(SampleContent.unreleased)


@pytest.fixture(scope="function")
@pytest.fixture
def unreleased_with_security_issues(changelog) -> str:
security = _markdown("""
## Security Issues
Expand All @@ -147,7 +147,7 @@ def unreleased_with_security_issues(changelog) -> str:
VulnerabilityChanges = tuple[Mock | dict, Mock | dict] | None


@pytest.fixture(scope="function")
@pytest.fixture
def dependency_changes(previous_dependencies, dependencies) -> DependencyChanges:
return (previous_dependencies, dependencies)

Expand Down Expand Up @@ -179,17 +179,17 @@ def mock(
return mock


@pytest.fixture(scope="function")
@pytest.fixture
def mock_no_dependencies(mock_changelog):
mock_changelog()


@pytest.fixture(scope="function")
@pytest.fixture
def mock_dependencies(mock_changelog, dependency_changes):
mock_changelog(dependencies=dependency_changes)


@pytest.fixture(scope="function")
@pytest.fixture
def vulnerability_changes(sample_vulnerability) -> VulnerabilityChanges:
"""
Simulate resolved vulnerabilities.
Expand All @@ -200,19 +200,19 @@ def vulnerability_changes(sample_vulnerability) -> VulnerabilityChanges:
return (previous, current)


@pytest.fixture(scope="function")
@pytest.fixture
def mock_vulnerabilties(mock_changelog, vulnerability_changes):
mock_changelog(vulnerabilities=vulnerability_changes)


@pytest.fixture(scope="function")
@pytest.fixture
def mock_dependencies_and_vulnerabilties(
mock_changelog, dependency_changes, vulnerability_changes
):
mock_changelog(dependency_changes, vulnerability_changes)


@pytest.fixture(scope="function")
@pytest.fixture
def mock_new_dependencies(mock_changelog, dependencies):
mock_changelog(
dependencies=(Mock(side_effect=LatestTagNotFoundError), dependencies)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/util/version_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def set_poetry_version(version):
stderr="",
)

yield set_poetry_version
return set_poetry_version


@pytest.mark.parametrize(
Expand Down