1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-26 07:41:33 +03:00

Make acme tests internal (#9625)

This is a first step towards implementing the plan I described at https://github.com/certbot/certbot/issues/7909#issuecomment-1448675456 which got a +1 from both Erica and Will. Similar changes for our other packages will be made in followup PRs to try and make this easier to review.

It may be helpful to look at https://github.com/certbot/certbot/pull/7600 when reviewing this PR where we did something similar in the past.

The value of `ignore-paths` in `.pylintrc` should work on Windows based on https://pylint.readthedocs.io/en/latest/user_guide/configuration/all-options.html#ignore-paths and the fact that on macOS/linux, changing path delimiters to `\` still causes these directories to be ignored.

I started testing this for mypy as well, but mypy doesn't current pass for us on Windows so I didn't bother and took this opportunity to remove it from the default environments in `tox.ini`. I'll update https://github.com/certbot/certbot/issues/7803 to mention that the value of `exclude` in `mypy.ini` may need to be tweaked if anyone works on that issue.

* make acme tests internal

* no mypy-win
This commit is contained in:
Brad Warren
2023-03-28 14:02:33 -07:00
committed by GitHub
parent e10e549a95
commit 6832521272
47 changed files with 20 additions and 10 deletions

View File

@@ -48,7 +48,10 @@ ignore=CVS
# ignore-list. The regex matches against paths and can be in Posix or Windows
# format. Because '\' represents the directory delimiter on Windows systems, it
# can't be used as an escape character.
ignore-paths=
# CERTBOT COMMENT
# Changing this line back to the default of `ignore-paths=` is being tracked by
# https://github.com/certbot/certbot/issues/7908.
ignore-paths=.*/_internal/tests/
# Files or directories matching the regular expression patterns are skipped.
# The regex matches against base names, not paths. The default value ignores

View File

@@ -3,7 +3,7 @@ include README.rst
include pytest.ini
recursive-include docs *
recursive-include examples *
recursive-include tests *
recursive-include acme/_internal/tests/testdata *
include acme/py.typed
global-exclude __pycache__
global-exclude *.py[cod]

View File

@@ -0,0 +1 @@
"""acme's internal implementation"""

View File

@@ -0,0 +1 @@
"""acme tests"""

View File

@@ -11,7 +11,7 @@ import pytest
import requests
from acme import errors
import test_util
from acme._internal.tests import test_util
CERT = test_util.load_comparable_cert('cert.pem')
KEY = jose.JWKRSA(key=test_util.load_rsa_private_key('rsa512_key.pem'))

View File

@@ -17,10 +17,10 @@ from acme import challenges
from acme import errors
from acme import jws as acme_jws
from acme import messages
from acme._internal.tests import messages_test
from acme._internal.tests import test_util
from acme.client import ClientNetwork
from acme.client import ClientV2
import messages_test
import test_util
CERT_SAN_PEM = test_util.load_vector('cert-san.pem')
CSR_MIXED_PEM = test_util.load_vector('csr-mixed.pem')

View File

@@ -14,7 +14,7 @@ import OpenSSL
import pytest
from acme import errors
import test_util
from acme._internal.tests import test_util
class SSLSocketAndProbeSNITest(unittest.TestCase):

View File

@@ -5,7 +5,7 @@ import unittest
import josepy as jose
import pytest
import test_util
from acme._internal.tests import test_util
KEY = jose.JWKRSA.load(test_util.load_vector('rsa512_key.pem'))

View File

@@ -10,7 +10,7 @@ import josepy as jose
import pytest
from acme import challenges
import test_util
from acme._internal.tests import test_util
CERT = test_util.load_comparable_cert('cert.der')
CSR = test_util.load_comparable_csr('csr.der')

View File

@@ -15,7 +15,7 @@ import requests
from acme import challenges
from acme import crypto_util
from acme import errors
import test_util
from acme._internal.tests import test_util
class TLSServerTest(unittest.TestCase):

View File

@@ -1,4 +1,7 @@
[mypy]
# Removing this exclude setting is being tracked by
# https://github.com/certbot/certbot/issues/7909.
exclude = .*/_internal/tests/
ignore_missing_imports = True
warn_unused_ignores = True
show_error_codes = True

View File

@@ -4,7 +4,9 @@
[tox]
skipsdist = true
envlist = {cover,lint,mypy}-{win,posix}
# mypy doesn't current pass for us on Windows. Fixing that is being tracked by
# https://github.com/certbot/certbot/issues/7803.
envlist = {cover,lint}-{win,posix},mypy-posix
[base]
# pip installs the requested packages in editable mode