Skip to content

fmt: off is ignored after first function #335

@virtuald

Description

@virtuald

Fedora 28, master black

Trying to work around #334 and ran into this.

Minimized test source:

import pytest

TmSt = 1
TmEx = 2

# fmt: off

# Test data:
#   Position, Volume, State, TmSt/TmEx/None, [call, [arg1...]]

@pytest.mark.parametrize('test', [

    # Test don't manage the volume
    [
        ('stuff', 'in')
    ],
])
def test_fader(test):
    pass

def check_fader(test):
    pass

def test_calculate_fades():
    calcs = [
        # one is zero/none
        (0, 4, 0, 0, 10,        0, 0, 6, 10),
        (None, 4, 0, 0, 10,     0, 0, 6, 10),
    ]

# fmt: on

Result:

import pytest

TmSt = 1
TmEx = 2

# fmt: off

# Test data:
#   Position, Volume, State, TmSt/TmEx/None, [call, [arg1...]]

@pytest.mark.parametrize('test', [

    # Test don't manage the volume
    [
        ('stuff', 'in')
    ],
])
def test_fader(test):
    pass


def check_fader(test):
    pass


def test_calculate_fades():
    calcs = [
        # one is zero/none
        (0, 4, 0, 0, 10, 0, 0, 6, 10),
        (None, 4, 0, 0, 10, 0, 0, 6, 10),
    ]


# fmt: on

Note that there are two things ignored:

  • Inserted extra lines between functions
  • the list of tuples in test_calculate_fades was reformatted

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions