Skip to content

Commit

Permalink
Battling coverage measurements on Python 2 and PyPy
Browse files Browse the repository at this point in the history
Turns out the concurrent.futures backport actually provides a package
'concurrent', so my fallback was never executed.
  • Loading branch information
mgedmin committed Aug 14, 2019
1 parent 9887457 commit d59785b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -15,6 +15,6 @@ coverage:

.PHONY: flake8
flake8:
flake8 src setup.py
tox -e flake8

include release.mk
12 changes: 3 additions & 9 deletions ghcloneall.py
Expand Up @@ -11,21 +11,15 @@
import subprocess
import sys
import threading
from concurrent import futures
from operator import itemgetter

try:
# Python 3
# Python 2
from ConfigParser import SafeConfigParser as ConfigParser
except ImportError: # pragma: PY3
# Python 2
from configparser import ConfigParser

try:
# Python 3
from concurrent import futures
except ImportError: # pragma: PY2
# Python 2 backport
import futures
from configparser import ConfigParser

import requests
import requests_cache
Expand Down
14 changes: 14 additions & 0 deletions tox.ini
Expand Up @@ -16,6 +16,20 @@ commands =
coverage run -m pytest {posargs}
coverage report -m --fail-under=100

[testenv:coverage-py2]
basepython = python2
deps = {[testenv:coverage]deps}
commands = {[testenv:coverage]commands}

[testenv:coverage-pypy]
basepython = pypy
deps = {[testenv:coverage]deps}
commands = {[testenv:coverage]commands}

[testenv:coverage-pypy3]
basepython = pypy3
deps = {[testenv:coverage]deps}
commands = {[testenv:coverage]commands}

[testenv:flake8]
deps = flake8
Expand Down

0 comments on commit d59785b

Please sign in to comment.