Skip to content

Commit

Permalink
Update content
Browse files Browse the repository at this point in the history
  • Loading branch information
sivaprasadreddy committed Dec 5, 2023
1 parent c7d2ae3 commit f4e8ef3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,16 @@ Now let's implement the tests as follows:
include::{codebase}/tests/test_customers.py[lines="28..40"]
----

* In the *test_get_all_customers()* test, we are inserting 2 customer records into the database,
* In the *test_get_all_customers()* test, we are inserting two customer records into the database,
fetching all the existing customers, and asserting the number of customers.
* In the *test_get_customer_by_email()* test, we are inserting a customer record into the database,
fetching the customer by email, and asserting the customer details.

As we are deleting all the customer records before every test, the tests can be run in any order.

== Run tests
To enable the Pytest https://pytest.org/explanation/goodpractices.html#test-discovery[auto-discovery] mechanism, create *\_\_init\_\_.py* file under *tests* directory with empty content.
To enable the Pytest https://pytest.org/explanation/goodpractices.html#test-discovery[auto-discovery] mechanism,
create *\__init__.py* file under *tests* directory with empty content.

Now let's run the tests using pytest as follows:

Expand Down

0 comments on commit f4e8ef3

Please sign in to comment.