Skip to content

Commit

Permalink
Merge pull request #34 from keszybz/py3.12-test-fix
Browse files Browse the repository at this point in the history
Adjust for whitespace changes with python 3.12
  • Loading branch information
smarie authored Nov 29, 2023
2 parents b39aeb2 + fca0671 commit 1d310c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tests/test_doc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import print_function

import re

import pytest
from makefun import wraps
Expand Down Expand Up @@ -182,7 +182,8 @@ def add_ints(a, b):
with capsys.disabled():
print(captured.out)

assert captured.out == """hello, world !
out = re.sub(r'[ \t]+\n', '\n', captured.out)
assert out == """hello, world !
<executing foo>
hello, world !
<executing bar>
Expand All @@ -195,7 +196,7 @@ def add_ints(a, b):
say_hello(person='world')
This decorator wraps the decorated function so that a nice hello
message is printed before each call.
:param person: the person name in the print message. Default = "world"
Signature: (person='world')
Expand Down
6 changes: 4 additions & 2 deletions tests/test_doc_advanced.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import print_function
import re
import sys

import pytest
Expand Down Expand Up @@ -200,15 +201,16 @@ def custom(a, b):
with capsys.disabled():
print(captured.out)

assert captured.out == """hello, world !
out = re.sub(r'[ \t]+\n', '\n', captured.out)
assert out == """hello, world !
hello, world !
hello, you !
Help on function say_hello in module tests.test_doc_advanced:
say_hello(person='world')
This decorator modifies the decorated function so that a nice hello
message is printed before the call.
:param person: the person name in the print message. Default = "world"
:param f: represents the decorated item. Automatically injected.
:return: a modified version of `f` that will print a hello message before executing
Expand Down

0 comments on commit 1d310c0

Please sign in to comment.