Skip to content

Commit

Permalink
pass foxylint
Browse files Browse the repository at this point in the history
  • Loading branch information
haarcuba committed Sep 13, 2024
1 parent 39bf584 commit 563f551
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ repos:
rev: releases/1.0.0
hooks:
- id: foxylint-imports
#args:
#- "--exclude=./etoro-emails/**/*.py"
#- "--accept=/from logger import logger/"
#- "--accept=/from xm_livechat.*import/"
#- "--accept=/from testix import/"
args:
- "--accept=/from testix.*import/"
- "--accept=/from examples import/"
- "--accept=/from unittest.*import/"
- "--exclude=./testix/__init__.py"
2 changes: 1 addition & 1 deletion chatbot/test/test_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import socket
from testix.frequentlyused import * # noqa: F403
from testix import patch_module # noqa: F401
from chatbot import chatbot
from chatbot import chatbot # foxylint-imports:ignore


class TestChatbot:
Expand Down
6 changes: 3 additions & 3 deletions chatbot/test/test_chatbot_with_unittest_mock.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from unittest.mock import patch
import unittest.mock
from unittest.mock import Mock, call
import chatbot.chatbot
import chatbot.responder
Expand All @@ -10,12 +10,12 @@ def construct(self, sock, Responder):
self.tested = chatbot.chatbot.Chatbot(sock)
Responder.assert_called_once_with()

@patch('chatbot.responder.Responder')
@unittest.mock.patch('chatbot.responder.Responder')
def test_construction(self, Responder):
sock = Mock()
self.construct(sock, Responder)

@patch('chatbot.responder.Responder')
@unittest.mock.patch('chatbot.responder.Responder')
def test_request_response_loop(self, Responder):
sock = Mock()
responder = Mock()
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/test_calculator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from testix.frequentlyused import * # noqa: F403
from testix import patch_module # noqa: F401
from examples import calculator
from examples import calculator # foxylint-imports:ignore


class Test_Calculator:
Expand Down
6 changes: 3 additions & 3 deletions examples/tests/test_daylight_with_starndard_mock.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from unittest.mock import patch
from unittest.mock import Mock
import unittest.mock

from examples import daylight

Expand All @@ -13,7 +13,7 @@ class Test_Daylight:
def module_patch(self, patch_module):
patch_module(daylight, 'datetime')

@patch('examples.daylight.datetime')
@unittest.mock.patch('examples.daylight.datetime')
def test_Main(self, datetime):
fakeDay = FakeDay()
fakeDay.hour = 12
Expand All @@ -26,7 +26,7 @@ def test_Main(self, datetime):
datetime.datetime.today.assert_called_once_with()
datetime.timedelta.assert_called_once()

@patch('examples.daylight.datetime')
@unittest.mock.patch('examples.daylight.datetime')
def test_EarlyInTheMorningUsesSameDate(self, datetime):
fakeDay = FakeDay()
fakeDay.hour = 2
Expand Down

0 comments on commit 563f551

Please sign in to comment.