We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02ee88c commit 1d0d9d7Copy full SHA for 1d0d9d7
exercises/05.1-sum_odd_items/test.py
@@ -1,9 +1,8 @@
1
import io, sys, os, pytest, re
2
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
3
4
-
5
@pytest.mark.it("Print the odd number")
6
-def test_odd_numbers(capsys, app):
+def test_odd_numbers(capsys):
7
import app
8
captured = capsys.readouterr()
9
assert "251\n" in captured.out
@@ -13,4 +12,12 @@ def test_for_loop():
13
12
with open(path, 'r') as content_file:
14
content = content_file.read()
15
regex = re.compile(r"for(\s)")
16
- assert bool(regex.search(content)) == True
+ assert bool(regex.search(content)) == True
+
17
+@pytest.mark.it("sumOdds function should exist")
18
+def test_function_exists():
19
+ import app
20
+ try:
21
+ assert app.sumOdds
22
+ except:
23
+ raise AttributeError("The function 'sumOdds' should exist")
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments