Is it possible to break a long function name across multiple lines?

后端 未结 7 1124
南旧
南旧 2021-02-04 23:02

Our development team uses a PEP8 linter which requires a maximum line length of 80 characters.

When I\'m writing unit tests in python, I like to have

相关标签:
7条回答
  • 2021-02-04 23:45

    Sort of a context-specific approach to the problem. The test case you've presented actually looks very much like a Natural Language format of describing the necessary steps for a test case to take.

    See if using the behave Behavior Driver development style framework would make more sense here. Your "feature" might look like (see how the given, when, then reflect what you had):

    Feature: Connect error testing
    
      Scenario: Client event listener receives connection refused error without server
         Given server is offline
          when client connect starts
          then client receives connection refused error
    

    There is also relevant pyspecs package, sample usage from a recent answer on a related topic:

    • Write descriptive unit tests
    0 讨论(0)
提交回复
热议问题