Skip to content

Commit

Permalink
Update 'logbreak' to support messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Jan 11, 2019
1 parent 87c2281 commit 9b5dad6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ def create_tmp():

@pytest.fixture
def logbreak():
def _():
width = get_terminal_size().columns - 30
line = '-' * width
def _(message=""):
width = get_terminal_size().columns - 31
if message:
line = '-' * (width - len(message) - 1) + ' ' + message
else:
line = '-' * width
log.info(line)

return _
Expand Down
6 changes: 3 additions & 3 deletions tests/test_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def with_getattribute(logbreak, write, expect):
item: b
""",
)
logbreak()
logbreak("Getting attribute")

expect(sample.item) == 'b'

Expand Down Expand Up @@ -91,10 +91,10 @@ def with_iter(write, expect):
expect([x for x in sample]) == [3]

def describe_nesting():
def with_getattr(write, expect):
def with_getattr(logbreak, write, expect):
sample = SampleWithNesting(1)

log.info("Modifying nested file")
logbreak("Modifying nested file")
write(
'tmp/sample.yml',
"""
Expand Down

0 comments on commit 9b5dad6

Please sign in to comment.