TOC Python (1)
TOC Python (1)
Topics
Introduction to Python.
File Handling
Exceptinon handling
Flask
Automation testing
CI Testing
code coverage/format/pattern/doc
Threading and processing
Subtopics
• Introduction to Python.
• Key features: High-level, interpreted, dynamically typed, object-oriented.
• Diverse applications: Data science, web development, automation, scripting, etc.
• Installing Python:
Choosing and configuring an IDE like VS Code, PyCharm, or Jupyter Notebook.
Understanding and using virtual environments (e.g., `venv`) to isolate project dependencies.
• Basic syntax: Indentation, comments, variables, and data types (integers, floats, numbers, booleans).
• Operators: Arithmetic, comparison, logical, bitwise.
• Strings: slicing, reversing, indexing, Accessing a Docstring, raw string, string formatting
• Built-in modules:
• ‘re’: pattern match by match, search, findall, finditer, subn, compile & fullmatch functions, check for the correct mail id
• `os`: change the current path, know the functions modules being used, create and delete directories and more.
• `sys`:how it works with back end memory management, path changing, printing messages and errors etc.
• `math`: floor, ceil, factorial, gcd, lcm etc.
• `random`:random, randint, random choices
• `datetime`, `calendar’: datetime data type, str and different ways to take and print date and time, text and HTML calend
• Importing modules: `import`, `from ... import`.
• Assertions in Pytest:
Using assert statements effectively
Custom error messages
Parameterized Testing: Running tests with multiple inputs
• Markers and Tags:
Organizing and filtering tests
Built-in and custom markers
• Mocking in Pytest: Using pytest-mock or unittest.mock
• Introduction to Tox:
What is Tox and its role in automation testing
Installation and setup
• Tox Configuration:
Understanding tox.ini file
Specifying environments and dependencies
• Running Tests Across Environments
Testing on multiple Python versions
Configuring virtual environments
Testing on multiple Python versions
Configuring virtual environments
Test Automation:
Unit Testing
Integration Testing
End-to-End Testing
API Testing
UI Testing
Testing Frameworks:
Unittest (Python)
Pytest (Python)
Test Coverage Analysis:
Measuring code coverage to identify untested areas.
CI/CD Tools & Pipelines:
Jenkins
Automating Tox in CI/CD pipelines
Using Tox with Jenkins/GitHub Actions
• Custom Commands in Tox
Writing and executing custom commands
Pre- and post-test hooks
Test Reporting:
Generating and analyzing test reports (JUnit XML, Allure Reports)