File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
exercises/03-Print-Variables-In-The-Console Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 55import pytest
66import app
77import os
8- import re
8+
99path = os .path .dirname (os .path .abspath (__file__ ))+ '/app.py'
1010
11- @pytest .mark .it (' Create a variable named " color" with the string value " red"' )
11+ @pytest .mark .it (" Create a variable named ' color' with the string value ' red'" )
1212def test_declare_variable ():
1313 result = app .color
1414 assert result == "red"
1515
16- @pytest .mark .it ('Print on the console the value of the variable' )
17- def test_for_printing_variable ():
18-
19- with open (path , 'r' ) as content_file :
20- content = content_file .read ()
21- regex = re .compile (r"print\s*\(\s*color\s*\)" )
22- assert bool (regex .search (content )) == True
16+ @pytest .mark .it ("Create a variable named 'item' with the string value 'marker'" )
17+ def test_declare_variable ():
18+ result = app .item
19+ assert result == "marker"
2320
24- @pytest .mark .it ('The printed value on the console should be "red"' )
21+ @pytest .mark .it ('The printed value on the console should be "red marker "' )
2522def test_for_file_output (capsys ):
2623 captured = buffer .getvalue ()
27- assert "red\n " in captured
24+ assert "red marker \n " in captured
You can’t perform that action at this time.
0 commit comments