mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:14:54 +02:00
Fix tox environments (#9547)
* fix cover tox envs * make test work on all Pythons * Remove unused import Co-authored-by: alexzorin <alex@zorin.id.au> Co-authored-by: alexzorin <alex@zorin.id.au>
This commit is contained in:
@@ -7,10 +7,10 @@ jobs:
|
|||||||
macos-py37-cover:
|
macos-py37-cover:
|
||||||
IMAGE_NAME: macOS-12
|
IMAGE_NAME: macOS-12
|
||||||
PYTHON_VERSION: 3.7
|
PYTHON_VERSION: 3.7
|
||||||
TOXENV: py37-cover
|
TOXENV: cover
|
||||||
macos-cover:
|
macos-cover:
|
||||||
IMAGE_NAME: macOS-12
|
IMAGE_NAME: macOS-12
|
||||||
TOXENV: py3-cover
|
TOXENV: cover
|
||||||
windows-py37:
|
windows-py37:
|
||||||
IMAGE_NAME: windows-2019
|
IMAGE_NAME: windows-2019
|
||||||
PYTHON_VERSION: 3.7
|
PYTHON_VERSION: 3.7
|
||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
windows-py39-cover:
|
windows-py39-cover:
|
||||||
IMAGE_NAME: windows-2019
|
IMAGE_NAME: windows-2019
|
||||||
PYTHON_VERSION: 3.9
|
PYTHON_VERSION: 3.9
|
||||||
TOXENV: py39-cover-win
|
TOXENV: cover-win
|
||||||
windows-integration-certbot:
|
windows-integration-certbot:
|
||||||
IMAGE_NAME: windows-2019
|
IMAGE_NAME: windows-2019
|
||||||
PYTHON_VERSION: 3.9
|
PYTHON_VERSION: 3.9
|
||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
TOXENV: py37
|
TOXENV: py37
|
||||||
linux-cover:
|
linux-cover:
|
||||||
IMAGE_NAME: ubuntu-22.04
|
IMAGE_NAME: ubuntu-22.04
|
||||||
TOXENV: py3-cover
|
TOXENV: cover
|
||||||
linux-lint:
|
linux-lint:
|
||||||
IMAGE_NAME: ubuntu-22.04
|
IMAGE_NAME: ubuntu-22.04
|
||||||
TOXENV: lint-posix
|
TOXENV: lint-posix
|
||||||
|
|||||||
@@ -94,18 +94,15 @@ class ErrorTest(unittest.TestCase):
|
|||||||
|
|
||||||
# this test is based on a minimal reproduction of a contextmanager/immutable
|
# this test is based on a minimal reproduction of a contextmanager/immutable
|
||||||
# exception related error: https://github.com/python/cpython/issues/99856
|
# exception related error: https://github.com/python/cpython/issues/99856
|
||||||
def test_with_context_manager(self):
|
def test_setting_traceback(self):
|
||||||
from acme.messages import Error
|
self.assertIsNone(self.error_custom.__traceback__)
|
||||||
|
|
||||||
@contextlib.contextmanager
|
|
||||||
def context():
|
|
||||||
yield
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with context():
|
1/0
|
||||||
raise self.error_custom
|
except ZeroDivisionError as e:
|
||||||
except Error as e:
|
self.error_custom.__traceback__ = e.__traceback__
|
||||||
self.assertIsNotNone(self.error_custom.__traceback__)
|
|
||||||
|
self.assertIsNotNone(self.error_custom.__traceback__)
|
||||||
|
|
||||||
|
|
||||||
class ConstantTest(unittest.TestCase):
|
class ConstantTest(unittest.TestCase):
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ For debugging, we recommend putting
|
|||||||
|
|
||||||
Once you are done with your code changes, and the tests in ``foo_test.py``
|
Once you are done with your code changes, and the tests in ``foo_test.py``
|
||||||
pass, run all of the unit tests for Certbot and check for coverage with ``tox
|
pass, run all of the unit tests for Certbot and check for coverage with ``tox
|
||||||
-e py3-cover``. You should then check for code style with ``tox -e lint`` (all
|
-e cover``. You should then check for code style with ``tox -e lint`` (all
|
||||||
files) or ``pylint --rcfile=.pylintrc path/to/file.py`` (single file at a
|
files) or ``pylint --rcfile=.pylintrc path/to/file.py`` (single file at a
|
||||||
time).
|
time).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user