Skip to content

Conversation

@MarkLark86
Copy link
Contributor

@MarkLark86 MarkLark86 commented Sep 5, 2025

Purpose

Modify the Behave and Pytest tests to use the new superdesk.core.tests module.

Depends on: superdesk/superdesk-core#3021

@MarkLark86 MarkLark86 added this to the v3.1 milestone Sep 5, 2025
@petrjasek petrjasek requested a review from Copilot September 5, 2025 08:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the Newsroom test infrastructure to be compatible with Superdesk v3.0 beta.1 by migrating from custom test implementations to the new superdesk.core.tests module.

  • Replaced custom test fixtures and environment setup with standardized core test utilities
  • Updated import statements to use the new superdesk.core.tests module
  • Modified test configuration for pytest asyncio scope and rate limiting
  • Refactored behave test environments to use new test factory pattern

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/conftest.py Replaces custom test fixtures with superdesk.core.tests imports and factory pattern
tests/core/test_saml.py Updates test client usage pattern for SAML tests
tests/core/test_auth.py Adds rate limiter configuration for auth tests
newsroom/tests/conftest.py Major refactoring to use new test factory pattern and remove custom event loop handling
newsroom/tests/web_api/environment.py Migrates to new behave test factory pattern
newsroom/tests/news_api/environment.py Migrates to new behave test factory pattern
features/*/environment.py Updates imports to remove deprecated before_scenario
features/mgmt_api/environment.py Migrates to new behave test factory pattern
newsroom/users/module.py Adds mongo configuration to users auth resource
newsroom/commands/remove_expired.py Updates import path for RemoveExpiredItems
setup.cfg Updates pytest asyncio configuration scope
dev-requirements.* Updates dependencies including superdesk-core branch and test libraries

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +85 to +86
def app_session(context: TestAppContext) -> None:
print("app_session")
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the debug print statement as it's not appropriate for production test code.

Suggested change
def app_session(context: TestAppContext) -> None:
print("app_session")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants