Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pygolang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
pygolang
Commits
2413b5ba
Commit
2413b5ba
authored
May 19, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
golang: tests: Factor file-reading into readfile() utility
We are going to use it from several places.
parent
0148cb89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
golang/golang_test.py
golang/golang_test.py
+7
-2
No files found.
golang/golang_test.py
View file @
2413b5ba
...
...
@@ -1546,8 +1546,7 @@ RuntimeError: aaa
# verify that dump of unhandled chained exception traceback works correctly (even on py2).
def
test_defer_excchain_dump
():
# run golang_test_defer_excchain.py and verify its output via doctest.
with
open
(
dir_testprog
+
"/golang_test_defer_excchain.txt"
,
"r"
)
as
f
:
tbok
=
f
.
read
()
tbok
=
readfile
(
dir_testprog
+
"/golang_test_defer_excchain.txt"
)
retcode
,
stdout
,
stderr
=
_pyrun
([
"golang_test_defer_excchain.py"
],
cwd
=
dir_testprog
,
stdout
=
PIPE
,
stderr
=
PIPE
)
assert
retcode
!=
0
...
...
@@ -1789,3 +1788,9 @@ def fmtargspec(f): # -> str
def test_fmtargspec():
def f(x, y=3, z=4, *argv, **kw): pass
assert fmtargspec(f) == '(x, y=3, z=4, *argv, **kw)'
# readfile returns content of file @path.
def readfile(path):
with open(path, "r") as f:
return f.read()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment