This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Custom macro for easy Vec<String> creation | |
| // Keywords: vec, String, to_string, macro, Rust, convert, collection | |
| // svec! simplifies creating Vecs of Strings from various types | |
| macro_rules! svec { | |
| ($($element:expr),* $(,)?) => { | |
| vec![$($element.to_string()),*] | |
| }; | |
| } | |
| use std::any::{Any, TypeId}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pytest | |
| from app import create_app | |
| @pytest.fixture() | |
| def app(): | |
| app = create_app() | |
| app.config.update({ | |
| "TESTING": True, | |
| }) | |
| # other setup can go here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will install Python dependencies, run tests and lint with a single version of Python | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
| name: pytest - Python unit tests | |
| on: | |
| push: | |
| branches: [ "master", "main"] | |
| pull_request: | |
| branches: [ "master", "main" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://github.com/astral-sh/ruff-pre-commit | |
| repos: | |
| - repo: https://github.com/astral-sh/ruff-pre-commit | |
| # Ruff version. | |
| rev: v0.2.1 | |
| hooks: | |
| # Run the linter. | |
| - id: ruff | |
| args: [ --fix -v ] | |
| # Run the formatter. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Ruff - Python Code Quality and Formatting | |
| on: [push, pull_request] | |
| jobs: | |
| lint-and-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |