Skip to content

Commit

Permalink
Fixed flake8 issue and corrected the comment file path
Browse files Browse the repository at this point in the history
  • Loading branch information
ritwik-g committed Jun 11, 2024
1 parent f23c9fb commit 7ba28ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
if: always()
uses: marocchino/sticky-pull-request-comment@v2
with:
path: .tox/latest/log/latest
path: .tox/worker/log/4-commands[0].log
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ commands_pre =
sh -c '[ -f cloud_requirements.txt ] && pip install -r cloud_requirements.txt || echo "cloud_requirements.txt not found"'
commands =
pytest -s --cov=. --cov-report=html --cov-report=term --html=report.html --self-contained-html

8 changes: 2 additions & 6 deletions worker/src/unstract/worker/clients/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ def test_logs(docker_container, mocker):
def test_cleanup(docker_container, mocker):
"""Test the cleanup method to ensure it removes the container."""
mock_container = mocker.patch.object(docker_container, "container")
Utils_remove_container_on_exit = mocker.patch(
f"{DOCKER_MODULE}.Utils.remove_container_on_exit", return_value=True
)
mocker.patch(f"{DOCKER_MODULE}.Utils.remove_container_on_exit", return_value=True)

docker_container.cleanup()
mock_container.remove.assert_called_once_with(force=True)
Expand All @@ -48,9 +46,7 @@ def test_cleanup(docker_container, mocker):
def test_cleanup_skip(docker_container, mocker):
"""Test the cleanup method to ensure it doesn't remove the container."""
mock_container = mocker.patch.object(docker_container, "container")
Utils_remove_container_on_exit = mocker.patch(
f"{DOCKER_MODULE}.Utils.remove_container_on_exit", return_value=False
)
mocker.patch(f"{DOCKER_MODULE}.Utils.remove_container_on_exit", return_value=False)

docker_container.cleanup()
mock_container.remove.assert_not_called()
Expand Down

0 comments on commit 7ba28ad

Please sign in to comment.