mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 22:33:00 -04:00
Skip some tests on certbot-apache on Windows to avoid pytest to fail
This commit is contained in:
parent
b9efadce45
commit
3446e77c43
2 changed files with 4 additions and 10 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import sys
|
||||
|
||||
|
||||
def pytest_ignore_collect(path, config): # pragma: no cover
|
||||
# Do not run any test for certbot-apache on Windows.
|
||||
# Do not run any test for certbot-apache on Windows, except obj_test which is safe
|
||||
# (to avoid pytest to fail because no test was found).
|
||||
if sys.platform == 'win32':
|
||||
return True
|
||||
return path.basename != 'obj_test.py'
|
||||
|
|
|
|||
|
|
@ -34,20 +34,12 @@ COVER_THRESHOLDS = {
|
|||
'certbot_nginx': {'linux': 97, 'windows': 97},
|
||||
}
|
||||
|
||||
SKIP_PROJECTS_ON_WINDOWS = ['certbot-apache']
|
||||
|
||||
|
||||
def cover(package):
|
||||
threshold = COVER_THRESHOLDS.get(package)['windows' if os.name == 'nt' else 'linux']
|
||||
|
||||
pkg_dir = package.replace('_', '-')
|
||||
|
||||
if os.name == 'nt' and pkg_dir in SKIP_PROJECTS_ON_WINDOWS:
|
||||
print((
|
||||
'Info: currently {0} is not supported on Windows and will not be tested/covered.'
|
||||
.format(pkg_dir)))
|
||||
return
|
||||
|
||||
subprocess.check_call([sys.executable, '-m', 'pytest',
|
||||
'--cov', pkg_dir, '--cov-append', '--cov-report=', pkg_dir])
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue