diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..d7072f7 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,22 @@ +build: false + +environment: + matrix: + - PYTHON: "C:/Python27" + - PYTHON: "C:/Python33" + - PYTHON: "C:/Python34" + - PYTHON: "C:/Python35" + +init: + - "ECHO %PYTHON%" + - ps: "ls C:/Python*" + +install: + - ps: (new-object net.webclient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'C:/get-pip.py') + - "%PYTHON%/python.exe C:/get-pip.py" + - "%PYTHON%/Scripts/pip.exe install -U setuptools" + - "%PYTHON%/python.exe setup.py develop" + - "%PYTHON%/Scripts/pip.exe install -U -r requirements.txt" + +test_script: + - "%PYTHON%/Scripts/py.test.exe -sv" diff --git a/tests/rules/test_ssh_known_host.py b/tests/rules/test_ssh_known_host.py index f2828a3..66b76e9 100644 --- a/tests/rules/test_ssh_known_host.py +++ b/tests/rules/test_ssh_known_host.py @@ -52,6 +52,7 @@ def test_match(ssh_error): assert not match(Command('ssh')) +@pytest.mark.skipif(os.name == 'nt', reason='Skip if testing on Windows') def test_side_effect(ssh_error): errormsg, path, reset, known_hosts = ssh_error command = Command('ssh user@host', stderr=errormsg) diff --git a/tests/test_corrector.py b/tests/test_corrector.py index ac95e54..164f61f 100644 --- a/tests/test_corrector.py +++ b/tests/test_corrector.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import pytest -from pathlib import PosixPath +from pathlib import Path from thefuck import corrector, const from tests.utils import Rule, Command, CorrectedCommand from thefuck.corrector import get_corrected_commands, organize_commands @@ -30,7 +30,7 @@ class TestGetRules(object): (['git.py', 'bash.py'], ['git'], ['git'], [])]) def test_get_rules(self, glob, settings, paths, conf_rules, exclude_rules, loaded_rules): - glob([PosixPath(path) for path in paths]) + glob([Path(path) for path in paths]) settings.update(rules=conf_rules, priority={}, exclude_rules=exclude_rules) diff --git a/tests/test_types.py b/tests/test_types.py index dcb4e87..2909412 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +import os from subprocess import PIPE from mock import Mock from pathlib import Path @@ -39,9 +40,10 @@ class TestRule(object): enabled_by_default=True, priority=900, requires_output=True)) - assert Rule.from_path(Path('/rules/bash.py')) \ + rule_path = os.path.join(os.sep, 'rules', 'bash.py') + assert Rule.from_path(Path(rule_path)) \ == Rule('bash', match, get_new_command, priority=900) - load_source.assert_called_once_with('bash', '/rules/bash.py') + load_source.assert_called_once_with('bash', rule_path) @pytest.mark.parametrize('rules, exclude_rules, rule, is_enabled', [ (const.DEFAULT_RULES, [], Rule('git', enabled_by_default=True), True),