Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: enable tests for documentation files #478

Merged
merged 12 commits into from
Dec 5, 2024
Merged

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Dec 4, 2024

In #469 we switched to use sybil for doctests, but we forgot to push docs/conftest.py to include the documentation files as well. This is fixed by this pull request.

Summary by Sourcery

Tests:

  • Enable testing of documentation files using sybil by adding a conftest.py file in the docs directory.

Copy link
Contributor

sourcery-ai bot commented Dec 4, 2024

Reviewer's Guide by Sourcery

This PR adds a conftest.py file to the docs directory to enable doctests using the sybil library. The implementation configures different test fixtures and Sybil instances to handle various documentation files with specific testing requirements.

Class diagram for the new conftest.py setup

classDiagram
    class Sybil {
        +DocTestParser[] parsers
        +String[] filenames
        +String[] fixtures
        +Function setup
    }
    class Pytest {
        +Fixture run_in_tmpdir
        +Fixture default_configuration
    }
    class AudbConfig {
        +String CACHE_ROOT
        +String SHARED_CACHE_ROOT
        +Repository[] REPOSITORIES
    }
    class Repository {
        +String name
        +String host
        +String backend
    }
    Sybil --> Pytest : uses
    Pytest --> AudbConfig : modifies
    AudbConfig --> Repository : contains
    note for Sybil "Sybil instances are configured for different documentation files with specific fixtures."
Loading

File-Level Changes

Change Details Files
Added pytest configuration for documentation testing
  • Created fixtures for temporary directory management and default configuration restoration
  • Set up doctest parsers with ELLIPSIS and NORMALIZE_WHITESPACE flags
  • Configured multiple Sybil instances for different documentation files with specific fixture requirements
docs/conftest.py
Configured test collection for different documentation file groups
  • Set up test collection for authentication, overview, quickstart, and other core documentation
  • Created separate configuration for publish documentation
  • Added specific configuration for configuration and caching documentation
docs/conftest.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @hagenw - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

docs/conftest.py Outdated Show resolved Hide resolved
@hagenw hagenw merged commit 6c075b2 into main Dec 5, 2024
8 checks passed
@hagenw hagenw deleted the enable-tests-for-docs branch December 5, 2024 08:18
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.

1 participant