Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all 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 deletions exercises/04-Multiply-Two-Values/test.py
Original file line number Diff line number Diff 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')
def test_for_print():
def test_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')
def test_for_print():
def test_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()"