diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aa10369..eababa6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,12 +21,6 @@ jobs: # The forced pytest versions correspond with the lower bounds in tox.ini pytest-version: ['', '--force-dep pytest==4', '--force-dep pytest==6.2.4'] include: - - os: 'ubuntu-20.04' - python-version: '3.5' - pytest-version: '' - - os: 'ubuntu-20.04' - python-version: '3.5' - pytest-version: '--force-dep pytest==4' - os: 'ubuntu-20.04' python-version: '3.6' exclude: diff --git a/pyproject.toml b/pyproject.toml index 6eb8170..6c4b23b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,5 +6,5 @@ build-backend = "setuptools.build_meta" write_to = "pytest_localserver/_version.py" [tool.black] -target-version = ['py35'] +target-version = ['py36'] line-length = 120 diff --git a/pytest_localserver/smtp.py b/pytest_localserver/smtp.py index 532d80a..0b285eb 100644 --- a/pytest_localserver/smtp.py +++ b/pytest_localserver/smtp.py @@ -95,16 +95,7 @@ def is_alive(self): @property def accepting(self): - try: - return self.server.is_serving() - except AttributeError: - # asyncio.base_events.Server.is_serving() only exists in Python 3.6 - # and up. For Python 3.5, asyncio.base_events.BaseEventLoop.is_running() - # is a close approximation; it should mostly return the same value - # except for brief periods when the server is starting up or shutting - # down. Once we drop support for Python 3.5, this branch becomes - # unnecessary. - return self.loop.is_running() + return self.server.is_serving() # for aiosmtpd <1.4 if not hasattr(aiosmtpd.controller.Controller, "_trigger_server"): diff --git a/setup.py b/setup.py index 438c4a3..d3b0d31 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def run(self): long_description=read("README.rst"), url="https://github.com/pytest-dev/pytest-localserver", packages=["pytest_localserver"], - python_requires=">=3.5", + python_requires=">=3.6", install_requires=["werkzeug>=0.10"], extras_require={ "smtp": [ @@ -59,7 +59,6 @@ def run(self): "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", diff --git a/tox.ini b/tox.ini index 263b570..cf9b349 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{35,36,37,38,39,310,311,312,py3}{,-smtp},lint +envlist = py{36,37,38,39,310,311,312,py3}{,-smtp},lint recreate = True isolated_build = True