Skip to content

Commit d56711d

Browse files
committed
Add reorder-python-imports pre-commit hook
1 parent 6d41fc4 commit d56711d

File tree

7 files changed

+19
-8
lines changed

7 files changed

+19
-8
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
exclude: '^($|.*\.bin)'
22
repos:
3+
- repo: https://github.com/asottile/reorder_python_imports
4+
rev: v3.8.2
5+
hooks:
6+
- id: reorder-python-imports
7+
args: ['--application-directories=.:src']
8+
name: reorder python imports
39
- repo: https://github.com/psf/black
410
rev: 22.3.0
511
hooks:

src/pytest_cpp/boost.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import io
12
import os
3+
import shutil
24
import subprocess
35
import tempfile
46
from xml.etree import ElementTree
5-
import io
6-
import shutil
7+
78
from pytest_cpp.error import CppTestFailure
89

910

src/pytest_cpp/error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import os
12
import string
23

3-
import os
44
from _pytest._code.code import ReprFileLocation
55

66

src/pytest_cpp/google.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from xml.etree import ElementTree
55

66
import pytest
7+
78
from pytest_cpp.error import CppTestFailure
89

910

src/pytest_cpp/plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
import pytest
77

88
from pytest_cpp.boost import BoostTestFacade
9-
from pytest_cpp.error import CppFailureRepr, CppFailureError
10-
from pytest_cpp.google import GoogleTestFacade
119
from pytest_cpp.catch2 import Catch2Facade
10+
from pytest_cpp.error import CppFailureError
11+
from pytest_cpp.error import CppFailureRepr
12+
from pytest_cpp.google import GoogleTestFacade
1213

1314
FACADES = [GoogleTestFacade, BoostTestFacade, Catch2Facade]
1415
DEFAULT_MASKS = ("test_*", "*_test")

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import os
22
import shutil
3-
import pytest
43
import sys
54

5+
import pytest
6+
67
pytest_plugins = "pytester"
78

89

tests/test_pytest_cpp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import subprocess
22
import sys
3-
from distutils.spawn import find_executable
43

54
import pytest
5+
from distutils.spawn import find_executable
66

77
from pytest_cpp import error
88
from pytest_cpp.boost import BoostTestFacade
99
from pytest_cpp.catch2 import Catch2Facade
10-
from pytest_cpp.error import CppFailureRepr, CppTestFailure
10+
from pytest_cpp.error import CppFailureRepr
11+
from pytest_cpp.error import CppTestFailure
1112
from pytest_cpp.google import GoogleTestFacade
1213

1314

0 commit comments

Comments
 (0)