Skip to content

test(python-sdk): add pytest integration tests for precheck() (GOV-37)#6

Closed
Shaivpidadi wants to merge 1 commit intofeat/1.4a-python-sdk-v2from
feat/1.4b-precheck-integration-test
Closed

test(python-sdk): add pytest integration tests for precheck() (GOV-37)#6
Shaivpidadi wants to merge 1 commit intofeat/1.4a-python-sdk-v2from
feat/1.4b-precheck-integration-test

Conversation

@Shaivpidadi
Copy link
Copy Markdown
Member

Summary

  • Adds tests/integration/test_precheck_integration.py with proper pytest integration tests for precheck() and async_precheck() against a local service
  • Both tests marked @pytest.mark.integration (skipped in CI unless -m integration is passed)
  • Fixes pyproject.toml: registers integration marker, adds pythonpath = ["src"], sets --import-mode=importlib
  • Adds conftest.py to ensure src/governs_ai takes precedence over legacy root package
  • Fixes missing Optional/Dict/Any imports in governs_ai/exceptions/precheck.py (Python 3.13 compat)

GovernsAI Tracker

GOV-37: 1.4b precheck() integration test

Test plan

  • 6 unit tests pass (pytest tests/test_client.py -m "not integration")
  • Integration tests in tests/integration/test_precheck_integration.py
  • Integration tests pass against http://localhost:8000

- tests/integration/test_precheck_integration.py: proper pytest tests
  (sync and async) marked @pytest.mark.integration
- pyproject.toml: register integration marker, add src pythonpath,
  switch to --import-mode=importlib so src/ takes priority over
  legacy root-level governs_ai/ directory
- conftest.py: insert src/ at sys.path[0] as safety fallback
- governs_ai/exceptions/precheck.py: add missing Optional/Dict/Any
  imports (Python 3.13 compat)

Refs: GOV-37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant