Skip to content

Commit 881410c

Browse files
committed
Merge branch 'update-mypy'
2 parents 15bbbe5 + 6d93868 commit 881410c

File tree

5 files changed

+49
-46
lines changed

5 files changed

+49
-46
lines changed

django_lightweight_queue/cron_scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_matcher(minval, maxval, t):
144144
# No module, move on.
145145
continue
146146

147-
app_cron_config: List[CronConfig] = mod.CONFIG # type: ignore[attr-defined]
147+
app_cron_config: List[CronConfig] = mod.CONFIG
148148
for row in app_cron_config:
149149
row['min_matcher'] = get_matcher(0, 59, row.get('minutes'))
150150
row['hour_matcher'] = get_matcher(0, 23, row.get('hours'))

poetry.lock

Lines changed: 39 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ freezegun = "^1.1.0"
3434
# Linting tools
3535
flake8 = "^4.0.0"
3636
isort = "^5.10"
37-
mypy = "^0.910"
37+
mypy = "^0.940"
3838

3939
# Flake 8 plugins
4040
flake8-bugbear = "^21.11.29"

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,5 @@ strict_equality = True
7676

7777
scripts_are_modules = True
7878
warn_unused_configs = True
79+
80+
enable_error_code = ignore-without-code

tests/test_task.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ def mocked_get_path(path: str) -> Any:
5353
return lambda: self.backend
5454
return get_path(path)
5555

56-
patch = mock.patch(
56+
backend_patch = mock.patch(
5757
'django_lightweight_queue.app_settings.BACKEND',
5858
new='test-backend',
5959
)
60-
patch.start()
61-
self.addCleanup(patch.stop)
62-
patch = mock.patch(
60+
backend_patch.start()
61+
self.addCleanup(backend_patch.stop)
62+
get_path_patch = mock.patch(
6363
'django_lightweight_queue.utils.get_path',
6464
side_effect=mocked_get_path,
6565
)
66-
patch.start()
67-
self.addCleanup(patch.stop)
66+
get_path_patch.start()
67+
self.addCleanup(get_path_patch.stop)
6868

6969
def tearDown(self) -> None:
7070
super().tearDown()

0 commit comments

Comments
 (0)