mirror of
https://github.com/TheLocehiliosan/yadm
synced 2024-10-27 20:34:27 +00:00
Lint using isort
This commit is contained in:
parent
bbc1ca17f0
commit
7af2af52ae
@ -7,7 +7,8 @@ import os
|
|||||||
import platform
|
import platform
|
||||||
import pwd
|
import pwd
|
||||||
import shutil
|
import shutil
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import PIPE, Popen
|
||||||
|
|
||||||
import py
|
import py
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@ -34,6 +35,12 @@ def pylint_version():
|
|||||||
return '2.17.0'
|
return '2.17.0'
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def isort_version():
|
||||||
|
"""Version of isort supported"""
|
||||||
|
return '5.12.0'
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='session')
|
@pytest.fixture(scope='session')
|
||||||
def flake8_version():
|
def flake8_version():
|
||||||
"""Version of flake8 supported"""
|
"""Version of flake8 supported"""
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Test alt"""
|
"""Test alt"""
|
||||||
import os
|
import os
|
||||||
import string
|
import string
|
||||||
|
|
||||||
import py
|
import py
|
||||||
import pytest
|
import pytest
|
||||||
import utils
|
import utils
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Test yadm.alt-copy"""
|
"""Test yadm.alt-copy"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
pytestmark = pytest.mark.usefixtures('ds1_copy')
|
pytestmark = pytest.mark.usefixtures('ds1_copy')
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
BOOTSTRAP_CODE = 123
|
BOOTSTRAP_CODE = 123
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Test config"""
|
"""Test config"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
TEST_SECTION = 'test'
|
TEST_SECTION = 'test'
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
KEY_FILE = 'test/test_key'
|
KEY_FILE = 'test/test_key'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Test enter"""
|
"""Test enter"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Test git"""
|
"""Test git"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Test list"""
|
"""Test list"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Test perms"""
|
"""Test perms"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Syntax checks"""
|
"""Syntax checks"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
@ -34,6 +35,16 @@ def test_pylint(pytestconfig, runner, pylint_version):
|
|||||||
assert run.success
|
assert run.success
|
||||||
|
|
||||||
|
|
||||||
|
def test_isort(pytestconfig, runner, isort_version):
|
||||||
|
"""Passes isort"""
|
||||||
|
if not pytestconfig.getoption("--force-linters"):
|
||||||
|
run = runner(command=['isort', '--version'], report=False)
|
||||||
|
if isort_version not in run.out:
|
||||||
|
pytest.skip('Unsupported isort version')
|
||||||
|
run = runner(command=['isort', '-c', 'test'])
|
||||||
|
assert run.success
|
||||||
|
|
||||||
|
|
||||||
def test_flake8(pytestconfig, runner, flake8_version):
|
def test_flake8(pytestconfig, runner, flake8_version):
|
||||||
"""Passes flake8"""
|
"""Passes flake8"""
|
||||||
if not pytestconfig.getoption("--force-linters"):
|
if not pytestconfig.getoption("--force-linters"):
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
"""Unit tests: copy_perms"""
|
"""Unit tests: copy_perms"""
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
OCTAL = '7654'
|
OCTAL = '7654'
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
"""Unit tests: remove_stale_links"""
|
"""Unit tests: remove_stale_links"""
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
"""Unit tests: template_j2cli & template_envtpl"""
|
"""Unit tests: template_j2cli & template_envtpl"""
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
FILE_MODE = 0o754
|
FILE_MODE = 0o754
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Unit tests: yadm.[git,gpg]-program"""
|
"""Unit tests: yadm.[git,gpg]-program"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Test upgrade"""
|
"""Test upgrade"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Test version"""
|
"""Test version"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
This module holds values/functions common to multiple tests.
|
This module holds values/functions common to multiple tests.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
ALT_FILE1 = 'test_alt'
|
ALT_FILE1 = 'test_alt'
|
||||||
ALT_FILE2 = 'test alt/test alt'
|
ALT_FILE2 = 'test alt/test alt'
|
||||||
|
Loading…
Reference in New Issue
Block a user