Skip to main content

Posts

Showing posts from April, 2024

SQL Joining

Inner Join: The INNER JOIN keyword returns only rows with a match in both tables. Left Join: The LEFT JOIN keyword returns all records from the left table (Customers), even if there are no matches in the right table (Orders). Right Join: The RIGHT JOIN keyword returns all records from the right table (Employees), even if there are no matches in the left table (Orders). Full Join:   The FULL OUTER JOIN keyword returns all matching records from both tables whether the other table matches or not. So, if there are rows in "Customers" that do not have matches in "Orders", or if there are rows in "Orders" that do not have matches in "Customers", those rows will be listed as well.

How To achieve 100% test coverage in pytest

Write Additional Tests : Write new test cases to cover the remaining lines of code. This might involve creating edge cases, boundary conditions, or scenarios that are not currently covered by your tests. Mock External Dependencies : If your code interacts with external dependencies such as databases, APIs, or file systems, use mocking to simulate these dependencies in your tests. This ensures that you can cover all the code paths without relying on the external environment. Refactor Code :  Sometimes, achieving full test coverage might require refactoring your code to make it more testable. This could involve breaking down large functions into smaller units, reducing dependencies between components, or making your code more modular.