File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 4
4
from assertpy .assertpy import assert_that , soft_assertions
5
5
from config import BASE_URI
6
6
7
+ '''
8
+ An integral part of any Test Automation Framework is the assertion library that you choose.
9
+ A test that doesn't assert anything is of very less value.
10
+ When it comes to choose an assertion library in Python, there are many options we can choose either something
11
+ out of your test like Unit Tests, and bunch of other modules.
12
+ We'll use Assertpy because it has really nice syntax and gives you many of the assert functions out of the box.
13
+ It's easy to use.
14
+ AssertPy is itself inspired from AssertJ which itself a very popular library in Java language.
15
+ Read more in Readme file : https://github.com/assertpy/assertpy
16
+ '''
17
+
7
18
8
19
def test_read_all_has_kent ():
9
20
# We use requests.get() with url to make a get request
10
21
response = requests .get (BASE_URI )
11
- # Added the soft_assertions() - we use this when we want our Tests to run successfully (means failing one test won't
12
- # stop the Test script's execution). It will Collect all the failed tests, consolidate all of them with the errors
13
- # and return all the failed test failures in last with the failure messages.
22
+ # Added the soft_assertions() - we use this when we want our Tests to run successfully (means failing one/any test
23
+ # won't stop the Test script's execution). It will Collect all the failed tests, consolidate all of them with the
24
+ # errors and return all the failed test failures in last with the failure messages.
14
25
with soft_assertions ():
15
26
# response from requests has many useful properties.
16
27
# we can assert on the response status code
You can’t perform that action at this time.
0 commit comments