mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-21 23:39:09 +00:00
Add checks to maintain a consistent Python code style and prevent bugs (#515)
A flake8 configuration is included in setup.cfg and the checks are executed automatically on Travis: * Ensures a consistent PEP8 code style * Does basic linting to prevent possible bugs
This commit is contained in:
committed by
Wenzel Jakob
parent
df81546965
commit
bad1740213
@@ -8,13 +8,12 @@ import pytest
|
||||
import textwrap
|
||||
import difflib
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
import contextlib
|
||||
|
||||
_unicode_marker = re.compile(r'u(\'[^\']*\')')
|
||||
_long_marker = re.compile(r'([0-9])L')
|
||||
_hexadecimal = re.compile(r'0x[0-9a-fA-F]+')
|
||||
_long_marker = re.compile(r'([0-9])L')
|
||||
_hexadecimal = re.compile(r'0x[0-9a-fA-F]+')
|
||||
|
||||
|
||||
def _strip_and_dedent(s):
|
||||
@@ -218,7 +217,7 @@ def _test_import_pybind11():
|
||||
"""
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
import pybind11_tests
|
||||
import pybind11_tests # noqa: F401 imported but unused
|
||||
except Exception as e:
|
||||
print("Failed to import pybind11_tests from pytest:")
|
||||
print(" {}: {}".format(type(e).__name__, e))
|
||||
|
||||
Reference in New Issue
Block a user