diff --git a/testing/code/test_source.py b/testing/code/test_source.py index 7982cfa35..995fabcf4 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -744,3 +744,19 @@ something '''""" result = getstatement(1, source) assert str(result) == "'''\n'''" + + +def test_getstartingblock_multiline(): + class A(object): + def __init__(self, *args): + frame = sys._getframe(1) + self.source = _pytest._code.Frame(frame).statement + + # fmt: off + x = A('x', + 'y' + , + 'z') + # fmt: on + values = [i for i in x.source.lines if i.strip()] + assert len(values) == 4 diff --git a/testing/code/test_source_multiline_block.py b/testing/code/test_source_multiline_block.py deleted file mode 100644 index 009bb87ae..000000000 --- a/testing/code/test_source_multiline_block.py +++ /dev/null @@ -1,28 +0,0 @@ -# flake8: noqa -import sys - -import _pytest._code - - -def test_getstartingblock_multiline(): - """ - This test was originally found in test_source.py, but it depends on the weird - formatting of the ``x = A`` construct seen here and our autopep8 tool can only exclude entire - files (it does not support excluding lines/blocks using the traditional #noqa comment yet, - see hhatto/autopep8#307). It was considered better to just move this single test to its own - file and exclude it from autopep8 than try to complicate things. - """ - - class A(object): - def __init__(self, *args): - frame = sys._getframe(1) - self.source = _pytest._code.Frame(frame).statement - - # fmt: off - x = A('x', - 'y' - , - 'z') - # fmt: on - values = [i for i in x.source.lines if i.strip()] - assert len(values) == 4 diff --git a/tox.ini b/tox.ini index adc4e9746..6e5d7ca68 100644 --- a/tox.ini +++ b/tox.ini @@ -151,14 +151,6 @@ commands = rm -rf /tmp/doc-exec* make regen -[testenv:fix-lint] -skipsdist = True -usedevelop = True -deps = - autopep8 -commands = - autopep8 --in-place -r --max-line-length=120 --exclude=test_source_multiline_block.py _pytest testing setup.py pytest.py - [testenv:jython] changedir = testing commands =