mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 10:15:11 +00:00
Use dedent for nice multiline string
This commit is contained in:
parent
2708376bdf
commit
a1471f6fb9
1 changed files with 7 additions and 5 deletions
|
|
@ -2,6 +2,7 @@
|
|||
# This program is distributed under the MIT license.
|
||||
|
||||
import io
|
||||
import textwrap
|
||||
|
||||
from python_toolbox import sys_tools
|
||||
from python_toolbox import temp_file_tools
|
||||
|
|
@ -277,11 +278,12 @@ def test_unavailable_source():
|
|||
sys_tools.TempSysPathAdder(str(folder)):
|
||||
module_name = 'iaerojajsijf'
|
||||
python_file_path = folder / ('%s.py' % (module_name,))
|
||||
content = (u'import pysnooper\n'
|
||||
'\n'
|
||||
'@pysnooper.snoop()\n'
|
||||
'def f(x):\n'
|
||||
' return x\n')
|
||||
content = textwrap.dedent(u'''
|
||||
import pysnooper
|
||||
@pysnooper.snoop()
|
||||
def f(x):
|
||||
return x
|
||||
''')
|
||||
with python_file_path.open('w') as python_file:
|
||||
python_file.write(content)
|
||||
module = __import__(module_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue