Commit 48bf6e4e authored by Satwik Kansal's avatar Satwik Kansal

FilePathcompleter: Use pyreadline for windows

* GNU readline is not available on Windows. Tries to import
  pyreadline if the readline module is not found.
* Adds coverage plugins that set the environment markers
  needed to enforce OS specific coverage.

Fixes #40
parent 58b55c35
Pipeline #11077018 passed with stage
in 1 minute and 39 seconds
......@@ -16,5 +16,5 @@ tests:
script:
- apk add --no-cache git
- pip install tox~=2.7 codecov~=2.0.5
- tox -e tests
- tox -e tests --develop
- codecov
import glob
import os
import readline
# GNU readline is not available for Windows
try:
import readline
except ImportError: # pragma Linux: no cover
import pyreadline as readline
def path_completer(text, state):
......
......@@ -24,14 +24,23 @@ env =
PYTHONHASHSEED=0
# PYTHONHASHSEED=0 is required to use same hashes in pytests-xdist's workers
[coverage:coverage_env_plugin]
markers = True
[coverage:run]
branch = True
cover_pylib = False
source =
coala_utils
plugins =
coverage_env_plugin
coverage_config_reload_plugin
[coverage:report]
fail_under = 100
show_missing = True
skip_covered = False
sort = Miss
exclude_lines =
pragma: no ?cover
pragma ${PLATFORM_SYSTEM}: no cover
import os
import readline
import shutil
import unittest
......@@ -8,6 +7,11 @@ from coala_utils.FilePathCompleter import (
from coala_utils.ContextManagers import (
retrieve_stdout, simulate_console_inputs)
try:
import readline
except ImportError:
import pyreadline as readline
class FilePathCompleterTest(unittest.TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment