mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 16:15:42 +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:
|
||||
IMAGE_NAME: macOS-12
|
||||
PYTHON_VERSION: 3.7
|
||||
TOXENV: py37-cover
|
||||
TOXENV: cover
|
||||
macos-cover:
|
||||
IMAGE_NAME: macOS-12
|
||||
TOXENV: py3-cover
|
||||
TOXENV: cover
|
||||
windows-py37:
|
||||
IMAGE_NAME: windows-2019
|
||||
PYTHON_VERSION: 3.7
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
windows-py39-cover:
|
||||
IMAGE_NAME: windows-2019
|
||||
PYTHON_VERSION: 3.9
|
||||
TOXENV: py39-cover-win
|
||||
TOXENV: cover-win
|
||||
windows-integration-certbot:
|
||||
IMAGE_NAME: windows-2019
|
||||
PYTHON_VERSION: 3.9
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
TOXENV: py37
|
||||
linux-cover:
|
||||
IMAGE_NAME: ubuntu-22.04
|
||||
TOXENV: py3-cover
|
||||
TOXENV: cover
|
||||
linux-lint:
|
||||
IMAGE_NAME: ubuntu-22.04
|
||||
TOXENV: lint-posix
|
||||
|
||||
@@ -94,18 +94,15 @@ class ErrorTest(unittest.TestCase):
|
||||
|
||||
# this test is based on a minimal reproduction of a contextmanager/immutable
|
||||
# exception related error: https://github.com/python/cpython/issues/99856
|
||||
def test_with_context_manager(self):
|
||||
from acme.messages import Error
|
||||
|
||||
@contextlib.contextmanager
|
||||
def context():
|
||||
yield
|
||||
def test_setting_traceback(self):
|
||||
self.assertIsNone(self.error_custom.__traceback__)
|
||||
|
||||
try:
|
||||
with context():
|
||||
raise self.error_custom
|
||||
except Error as e:
|
||||
self.assertIsNotNone(self.error_custom.__traceback__)
|
||||
1/0
|
||||
except ZeroDivisionError as e:
|
||||
self.error_custom.__traceback__ = e.__traceback__
|
||||
|
||||
self.assertIsNotNone(self.error_custom.__traceback__)
|
||||
|
||||
|
||||
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``
|
||||
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
|
||||
time).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user