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

Sign up
Appearance settings

Commit 54302a6

Browse files
committed
done
1 parent dc77b9d commit 54302a6

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

‎.learn/resets/04.1-count_on/app.py

Lines changed: 0 additions & 7 deletions
This file was deleted.
4.25 KB
Binary file not shown.

‎exercises/04.1-count_on/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44

55
#your code go here:
6-
6+
hello= [[2, 1], {'name': 'juan'}]
77
print(hello)

‎exercises/04.1-count_on/test.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import io, sys, os, pytest, re
22
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
33

4-
@pytest.mark.it("You have to print the value of the variable 'hello' in the console")
5-
def test_all_data_type(capsys, app):
6-
app()
7-
captured = capsys.readouterr()
8-
assert "[[2, 1], {'name': 'juan'}]\n" in captured.out
4+
5+
@pytest.mark.it("The variable `hello` should exist")
6+
def test_for_loop():
7+
with open(path, 'r') as content_file:
8+
content = content_file.read()
9+
regex = re.compile(r"hello")
10+
assert bool(regex.search(content)) == True
11+
912

1013
@pytest.mark.it("You have to use a for loop")
1114
def test_for_loop():
@@ -20,3 +23,9 @@ def test_if():
2023
content = content_file.read()
2124
regex = re.compile(r"if(\s)")
2225
assert bool(regex.search(content)) == True
26+
27+
@pytest.mark.it("You have to print the value of the variable 'hello' in the console")
28+
def test_all_data_type(capsys, app):
29+
app()
30+
captured = capsys.readouterr()
31+
assert "[[2, 1], {'name': 'juan'}]\n" in captured.out

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /