pytest.ini 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. [pytest]
  2. # ============================================================================
  3. # Test Discovery
  4. # ============================================================================
  5. testpaths = tests
  6. python_files = test_*.py
  7. python_classes = Test*
  8. python_functions = test_*
  9. # ============================================================================
  10. # Async Support
  11. # ============================================================================
  12. asyncio_mode = auto
  13. asyncio_default_fixture_loop_scope = function
  14. # ============================================================================
  15. # Output Configuration
  16. # ============================================================================
  17. # Show extra test summary info for all test outcomes except passed
  18. addopts =
  19. -ra
  20. --strict-markers
  21. --strict-config
  22. --showlocals
  23. --tb=short
  24. -v
  25. # ============================================================================
  26. # Coverage Configuration
  27. # ============================================================================
  28. # Coverage options (used with pytest-cov)
  29. # Run with: pytest --cov=src --cov-report=html --cov-report=term
  30. [coverage:run]
  31. source = src
  32. omit =
  33. */tests/*
  34. */test_*.py
  35. */__pycache__/*
  36. */site-packages/*
  37. */conftest.py
  38. [coverage:report]
  39. # Fail if coverage is below 80%
  40. fail_under = 80
  41. precision = 2
  42. show_missing = True
  43. skip_covered = False
  44. exclude_lines =
  45. # Have to re-enable the standard pragma
  46. pragma: no cover
  47. # Don't complain about missing debug-only code
  48. def __repr__
  49. # Don't complain if tests don't hit defensive assertion code
  50. raise AssertionError
  51. raise NotImplementedError
  52. # Don't complain if non-runnable code isn't run
  53. if __name__ == .__main__.:
  54. # Don't complain about abstract methods
  55. @abstractmethod
  56. @abc.abstractmethod
  57. # Don't complain about type checking code
  58. if TYPE_CHECKING:
  59. # Don't complain about protocol methods
  60. \.\.\.
  61. [coverage:html]
  62. directory = htmlcov
  63. # ============================================================================
  64. # Test Markers
  65. # ============================================================================
  66. markers =
  67. unit: Unit tests that test individual components in isolation
  68. integration: Integration tests that test component interactions
  69. e2e: End-to-end tests that test complete user workflows
  70. slow: Tests that take a long time to run (> 1 second)
  71. requires_db: Tests that require a database connection
  72. requires_vector_db: Tests that require a vector database connection
  73. requires_external_service: Tests that require external services
  74. property: Property-based tests using Hypothesis
  75. asyncio: Async tests using pytest-asyncio
  76. # ============================================================================
  77. # Logging Configuration
  78. # ============================================================================
  79. log_cli = false
  80. log_cli_level = INFO
  81. log_cli_format = %(asctime)s [%(levelname)8s] %(message)s
  82. log_cli_date_format = %Y-%m-%d %H:%M:%S
  83. log_file = tests/logs/pytest.log
  84. log_file_level = DEBUG
  85. log_file_format = %(asctime)s [%(levelname)8s] %(name)s - %(message)s
  86. log_file_date_format = %Y-%m-%d %H:%M:%S
  87. # ============================================================================
  88. # Warning Configuration
  89. # ============================================================================
  90. filterwarnings =
  91. error
  92. # Ignore specific warnings from third-party libraries
  93. ignore::DeprecationWarning:pkg_resources
  94. ignore::PendingDeprecationWarning
  95. # Ignore warnings from hypothesis
  96. ignore::hypothesis.errors.NonInteractiveExampleWarning
  97. # ============================================================================
  98. # Timeout Configuration
  99. # ============================================================================
  100. # Uncomment to enable test timeouts (requires pytest-timeout)
  101. # timeout = 300
  102. # timeout_method = thread
  103. # ============================================================================
  104. # Parallel Execution
  105. # ============================================================================
  106. # Uncomment to enable parallel test execution (requires pytest-xdist)
  107. # addopts = -n auto
  108. # ============================================================================
  109. # Test Selection
  110. # ============================================================================
  111. # Minimum Python version required
  112. minversion = 3.11
  113. # ============================================================================
  114. # Doctest Configuration
  115. # ============================================================================
  116. doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
  117. # ============================================================================
  118. # Console Output
  119. # ============================================================================
  120. console_output_style = progress