mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-04 12:24:09 +01:00
Merge pull request #3868 from modoboa/add-python-314
chore(ci): add Python 3.14 for tests
This commit is contained in:
@@ -72,7 +72,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
database: ['postgres', 'mysql']
|
database: ['postgres', 'mysql']
|
||||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.12-alpine3.20 AS base
|
FROM python:3.14-alpine AS base
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Antoine Nguyen <tonio@ngyn.org>"
|
LABEL org.opencontainers.image.authors="Antoine Nguyen <tonio@ngyn.org>"
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,11 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
"""Entry point."""
|
"""Entry point."""
|
||||||
loop = asyncio.get_event_loop()
|
try:
|
||||||
|
loop = asyncio.get_event_loop()
|
||||||
|
except RuntimeError:
|
||||||
|
loop = asyncio.new_event_loop()
|
||||||
|
asyncio.set_event_loop(loop)
|
||||||
coro = asyncio.start_server(
|
coro = asyncio.start_server(
|
||||||
core.new_connection, options["host"], options["port"]
|
core.new_connection, options["host"], options["port"]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
from aiosmtplib import send
|
from aiosmtplib import send
|
||||||
from unittest.mock import AsyncMock
|
from unittest.mock import AsyncMock
|
||||||
|
import multiprocessing
|
||||||
from multiprocessing import Process
|
from multiprocessing import Process
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
from django import db
|
from django import db
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.test import TransactionTestCase
|
from django.test import TransactionTestCase
|
||||||
@@ -21,6 +21,8 @@ from modoboa.policyd import core as policyd_core
|
|||||||
|
|
||||||
from . import constants
|
from . import constants
|
||||||
|
|
||||||
|
multiprocessing.set_start_method("fork")
|
||||||
|
|
||||||
|
|
||||||
def start_policy_daemon():
|
def start_policy_daemon():
|
||||||
call_command("policy_daemon")
|
call_command("policy_daemon")
|
||||||
@@ -56,7 +58,7 @@ class PolicyDaemonTestCase(RedisTestCaseMixin, ParametersMixin, TransactionTestC
|
|||||||
self.process.daemon = True
|
self.process.daemon = True
|
||||||
self.process.start()
|
self.process.start()
|
||||||
# Wait a bit for the daemon to start
|
# Wait a bit for the daemon to start
|
||||||
self.process.join(0.1)
|
self.process.join(1.0)
|
||||||
|
|
||||||
def set_domain_limit(self, name, value):
|
def set_domain_limit(self, name, value):
|
||||||
"""Set daily limit for domain."""
|
"""Set daily limit for domain."""
|
||||||
|
|||||||
Reference in New Issue
Block a user