Movatterモバイル変換


[0]ホーム

URL:


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

Fix: Renamed duplicate test function, added assertion messages for cl…#122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Sean-Randall wants to merge1 commit into4GeeksAcademy:master
base:master
Choose a base branch
Loading
fromSean-Randall:fix-test-name-duplicate
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletionsexercises/04-Multiply-Two-Values/test.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,16 +26,16 @@ def test_for_file_output(capsys):
assert '17172435\n' in captured

@pytest.mark.it('Print on the console the variables_are_cool variable')
deftest_for_print():
deftest_prints_variable():
with open(path, 'r') as content_file:
content = content_file.read()
# makes sure we are calling print function with a variable and not the hard coded value
regex = re.compile(r"print\s*\(\s*variables_are_cool\s*\)")
assert bool(regex.search(content)) == True
assert bool(regex.search(content)) == True, "Expected print statement to use the variable 'variables_are_cool'"

@pytest.mark.it('You should not hardcode the result')
deftest_for_print():
deftest_does_not_hardcode_result():
with open(path, 'r') as content_file:
content = content_file.read()
# makes sure we are calling print function with a variable and not the hard coded value
assert str(17172435) not in content
assert str(17172435) not in content, "Do not hardcode the result directly in print()"

[8]ページ先頭

©2009-2025 Movatter.jp