alfredodeza / pytest.vim

Runs your UnitTests with py.test displaying red/green bars and errors
274 stars 40 forks source link

Check for method declarations across multiple lines. #43

Closed joetsoi closed 7 years ago

joetsoi commented 8 years ago

This regex doesn't detect method declarations that span multiple lines. It's a bit of an edge case.

For example

class TestSomething:
    def test_with_a_ridiculously_long_long_name_in_a_galaxy_far_far_away(
            self, some, parameters):
        ...

will be skipped,

I've changed regex to search to allow for methods with "def" and "self" that span multiple lines using the \_s to detect for newlines/spaces/tabs. For some reason I worry though, regexes are always seem nontrivial to deal with

alfredodeza commented 7 years ago

Sorry it took a while to get at this one, had the change applied locally and never had an issue.