8000 Fix test of Exercise 2, Input-Output (#91) · gaehlerm/python-tutorial@baf18d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit baf18d3

Browse 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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorial/tests/test_input_output.py

Lines 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. 5EB2 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