Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit baf18d3

Browse filesBrowse files
baffelliedoardob90
andauthored
Fix test of Exercise 2, Input-Output (empa-scientific-it#91)
Co-authored-by: Simone Baffelli <simone.baffelli@empa.ch> Co-authored-by: Edoardo Baldi <edoardob90@gmail.com>
1 parent 6e24aad commit baf18d3
Copy full SHA for baf18d3

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎tutorial/tests/test_input_output.py

Copy file name to clipboardExpand all lines: tutorial/tests/test_input_output.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ def test_exercise1(function_to_test):
2727

2828
def reference_solution_exercise2(f: pl.Path)-> int:
2929
with open(f) as lines:
30-
return len(lines.readlines())
30+
return len(list(itertools.chain.from_iterable([l.split() for l in lines.readlines()])))
3131

3232
def test_exercise2(function_to_test):
33-
f = get_data("example.csv")
33+
f = get_data("lines.txt")
3434
assert function_to_test(f) == reference_solution_exercise2(f)
3535

3636

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.