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

ResultWizard project #18

Merged
merged 151 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
d7b26f8
Init ValueWizard with basic project metadata
Splines Feb 16, 2024
ab59f3a
Init `valuewizard.result` module
Splines Feb 17, 2024
53369a4
Add helpful link to Readme (guide to write a Readme)
Splines Feb 17, 2024
3c381a9
Init some VSCode settings/extensions
Splines Feb 17, 2024
4ce953d
Improve package discovery & add dummy `res` method
Splines Feb 17, 2024
1e3eb1b
Setup linting/formatting with PyLint & black
Splines Feb 17, 2024
302b2f0
Add some words to spell checker
Splines Feb 17, 2024
be818b5
Use pipenv for virtualenv and lockfile management
Splines Feb 17, 2024
7f7241f
Add linting to GitHub workflow
Splines Feb 17, 2024
9e955d2
Fix too long line
Splines Feb 17, 2024
aae6782
Init very basic result API
Splines Feb 17, 2024
b268881
Add line length to black formatter
Splines Feb 17, 2024
2463154
Init basic uncertainty API via tuples
Splines Feb 17, 2024
3afaeb8
Restructure code using clean architecture
Splines Feb 24, 2024
1014bf5
Use `plum` to use method "overloading" in Python
Splines Feb 25, 2024
18c7cbe
Use typing module for backwards-compatibility
Splines Feb 25, 2024
d630b47
Don't use `|` pipes, instead use Union type
Splines Feb 25, 2024
10bce5d
Use @dataclass and assume right datatypes in domain
Splines Feb 25, 2024
e04454f
Add dummy impl of rounding/conversion pipeline
Splines Feb 25, 2024
e0e5537
Update readme with checklist for next commits
Splines Feb 25, 2024
13b4330
Add `plum-dispatch` as dependency
Splines Feb 25, 2024
ebf3f9d
Update intro/dev guide
Splines Feb 25, 2024
a575886
Add method "get_latex_str" to PrintableResult
paul019 Mar 13, 2024
a223b77
Change string representation of multiple uncertainties
paul019 Mar 13, 2024
18952bb
Add test case to playground
paul019 Mar 13, 2024
5a33f43
Add sigfigs and decimal places. Add more ways to specify uncertainties.
paul019 Mar 13, 2024
f2ea710
Add helper class
paul019 Mar 13, 2024
061c185
Change the way to deal with exact values. Specify rounding hierarchy …
paul019 Mar 13, 2024
4a0c9e2
Update rounding hierarchy in doc string
paul019 Mar 13, 2024
1c1e600
Add instructions to result LaTeX file
paul019 Mar 13, 2024
abdb092
Add logo draft to Readme
Splines Mar 13, 2024
ec1a2e7
Replace png logo with svg version
Splines Mar 13, 2024
9a189e0
Add rounder and latexer
paul019 Mar 13, 2024
28a44ba
Merge branch 'value-wizard' of https://github.com/paul019/ValueWizard…
paul019 Mar 13, 2024
f92dc78
Add stringifier and update playground
paul019 Mar 13, 2024
fc3856c
Update stringifier.py
paul019 Mar 13, 2024
7d1b340
Bug fixes and update playground
paul019 Mar 13, 2024
843a137
Replace "!" by "." in error message
paul019 Mar 13, 2024
5500a4e
Improve stringifier to make units more human-readable
paul019 Mar 13, 2024
e4afcd4
Add latex name parsing to avoid errors
paul019 Mar 13, 2024
ef9e698
Fix small bug
paul019 Mar 13, 2024
9392786
Update settings.json
paul019 Mar 13, 2024
1bcf09a
Update author names
paul019 Mar 13, 2024
3103dd3
Update Python linter settings
paul019 Mar 13, 2024
de77928
Fix minor issues concerning types and imports
paul019 Mar 13, 2024
10c4092
Add convenience feature for German language
paul019 Mar 13, 2024
a881adf
Add Pytest & integrate it into VSCode
Splines Mar 13, 2024
e417b39
Add guide on how to test to markdown
Splines Mar 14, 2024
6731a64
Run tests via GitHub actions
Splines Mar 14, 2024
2299379
Merge remote-tracking branch 'origin/value-wizard' into value-wizard
Splines Mar 14, 2024
2a6b2a7
Try to break test (for GitHub actions UI)
Splines Mar 14, 2024
8a77239
Fix failing dummy test
Splines Mar 14, 2024
f0ea17c
Delete old code in `archive` folder
Splines Mar 14, 2024
998a0b9
Add more words (mostly latex-related) to cspell dict
Splines Mar 14, 2024
6596bdb
Get rid of warnings
paul019 Mar 14, 2024
a123e06
Make correction in DEVELOPMENT.md
paul019 Mar 14, 2024
537244b
Implement rounder test
paul019 Mar 14, 2024
d1d7d11
Refactor res.py and move parsers to application
paul019 Mar 14, 2024
d4f9b77
Remove print statements
paul019 Mar 14, 2024
554cca7
Move python testing settings to better section
Splines Mar 14, 2024
ab951b1
Fix tests not running with GitHub actions
Splines Mar 14, 2024
6e000d5
Invoke pytest correctly in Actions
Splines Mar 14, 2024
1d045a7
Rename project to `ResultWizard`
Splines Mar 14, 2024
2065616
Get rid of unnecessary `_res_cache` variable
Splines Mar 14, 2024
8e99d5a
Move parsers to api
paul019 Mar 14, 2024
b700b33
Make small fix regarding parenthesis in output strings and test it in…
paul019 Mar 14, 2024
a364a42
Add TODO
paul019 Mar 14, 2024
b83316f
Add first draft for configuration
Splines Mar 14, 2024
e1af3b6
Redesign config such that defaults are visible in API
Splines Mar 14, 2024
767c89e
Add link to possible pluml fix
Splines Mar 14, 2024
9a0d277
Move `_res_cache` instantiation to API
Splines Mar 14, 2024
07146a2
Use configuration in LaTeXer
Splines Mar 14, 2024
f4df2be
Make Rounder configurable
Splines Mar 14, 2024
39ff7c4
Also replace capitalized "ß" (ẞ) in name parser
Splines Mar 14, 2024
a584206
Add support for decimal places in Rounder
Splines Mar 15, 2024
9a0299d
Remove unnecessary else branch
Splines Mar 15, 2024
215c756
Raise errors when user passes in empty name
Splines Mar 15, 2024
99549cc
Implement "print auto" & fix broken config share
Splines Mar 15, 2024
8ee4d0b
Use configuration in stringifier
Splines Mar 15, 2024
ca331cc
Remove unnecessary import mode config
Splines Mar 15, 2024
3d0432d
Fix package discovery
Splines Mar 15, 2024
b102601
Remove unnecessary JSON printouts in config
Splines Mar 15, 2024
75a3db2
Add TODO to support int values
Splines Mar 15, 2024
8d00de8
Always add a "valueOnly" option & do not include unit
Splines Mar 15, 2024
a2ee1d7
Fix wrong caller syntax in tests
Splines Mar 15, 2024
78babce
Fix missing copy of python objects
Splines Mar 15, 2024
09c1fc0
Let all negative values signify "no decimal places specified"
Splines Mar 15, 2024
f6a8fc3
Remove dummy mail from project settings
Splines Mar 15, 2024
42c4044
Regenerate lockfile & fix missing dependency
Splines Mar 15, 2024
9590ffa
Allow python versions down to `3.8`
Splines Mar 15, 2024
29f6c05
Fix error message for short results
paul019 Mar 15, 2024
ee01e73
Fix capital ß
paul019 Mar 15, 2024
bccdef2
Improve parsing of names
paul019 Mar 15, 2024
9757fbc
Add support for int values
paul019 Mar 15, 2024
bc3c7ad
Add option "without error" to latexer
paul019 Mar 15, 2024
9b0f11f
Move the parsing of exact values from domain to api
paul019 Mar 15, 2024
ef2bc83
Remove unnecessary imports
paul019 Mar 15, 2024
9ad1256
Add more rounding options to config
paul019 Mar 15, 2024
3a274d0
Change rounding hierarchy (prioritize settings in single results over…
paul019 Mar 15, 2024
45504e3
Return errors when making wrong settings in config
paul019 Mar 15, 2024
71cfa44
Update rounder_test.py
paul019 Mar 15, 2024
f429ec1
Raise error when user specifies sigfigs and decimal places
paul019 Mar 15, 2024
21b7ba1
Refactor result to latex cmd via builder pattern
Splines Mar 15, 2024
ce5a7f1
Merge remote-tracking branch 'origin/value-wizard' into value-wizard
Splines Mar 15, 2024
da5d0ec
Only include non-empty keywords to error list
Splines Mar 15, 2024
d07f144
Fix latexer else branch
Splines Mar 15, 2024
0a4c438
Reduce spacing between value and unit
Splines Mar 15, 2024
06a3d21
Simplify creation of latex string
Splines Mar 15, 2024
1a735c8
Rename to `to_latex_str` & add docstrings
Splines Mar 15, 2024
5977add
Remove outdated todo notes
Splines Mar 15, 2024
a66ffff
Fix misunderstood "requires" key
Splines Mar 15, 2024
3219583
Add docstring & disable some pylint warnings
Splines Mar 15, 2024
3fb7ec0
Fix more pylint warnings
Splines Mar 15, 2024
d3395a1
Fix too-few-public-methods & other small pylint warnings
Splines Mar 15, 2024
68fd9d0
Refactor stringifier
paul019 Mar 15, 2024
d6adf88
Remove unnecessary imports
paul019 Mar 15, 2024
c6b1c6b
Add support for parsing of numbers up to 999 in names
paul019 Mar 15, 2024
ef1ee87
Create release workflow for PyPI
Splines Mar 15, 2024
b988fd7
Add very basic install & usage instructions
Splines Mar 15, 2024
557d860
Implement master stringifier that is customized by latexer and string…
paul019 Mar 15, 2024
dca2e75
Use Protocol for MasterStringifier
Splines Mar 15, 2024
d7345cf
Use more meaningful names for stringifiers
Splines Mar 15, 2024
94209da
Get rid of unnecessary "_ClassName" convention
Splines Mar 15, 2024
9952a1a
Remove unwanted comments in domain/Value
Splines Mar 15, 2024
6ae7c55
Refactor name parser
Splines Mar 15, 2024
e457ce1
Add "number to word" tests & forbid too small/big numbers
Splines Mar 15, 2024
d5ef148
Fix pylint errors in tests
Splines Mar 15, 2024
26c0fe9
Reorganize import in test
Splines Mar 15, 2024
c3a8151
Improve pyproject description
Splines Mar 16, 2024
3ee6f8c
Restore old greedy digit counting
Splines Mar 16, 2024
57e8737
Add some name parser tests & extract method
Splines Mar 16, 2024
2be5700
Add tests for special char parsing
Splines Mar 16, 2024
1cd31aa
Add first test for value parser
Splines Mar 16, 2024
0075a50
Use "SS" instead of "Ss" as replacement for "ẞ"
Splines Mar 16, 2024
fcf0e44
Use \num{} for latex values
Splines Mar 16, 2024
34f797f
Rename `latex_str` to `string` in `stringifier.py`
Splines Mar 16, 2024
5a6a07d
Add `siunitx` import in resulting tex file & add to docs
Splines Mar 16, 2024
c6d680b
Replace _modify_value by value_prefix and value_suffix in stringifier
paul019 Mar 16, 2024
f894c15
Always print uncertainty name when user specifies it
paul019 Mar 16, 2024
7fb8e1a
Add a warning when shadowing values in cache.
paul019 Mar 16, 2024
c201917
Add error message when user gives exact value AND specifies sigfigs/d…
paul019 Mar 16, 2024
89e6c17
Add error message to runtime error in rounder
paul019 Mar 16, 2024
66fb173
Remove todo in value.py
paul019 Mar 16, 2024
d11658f
Disallow int for uncertainties in certain cases to prevent ambiguitie…
paul019 Mar 16, 2024
6cfcf94
Disable too-many-locals in stringifier
paul019 Mar 16, 2024
56b94e0
Improve runtime error messages
Splines Mar 16, 2024
d518728
Add latex option to call result "withoutUnit"
Splines Mar 16, 2024
61ba561
Add troubleshooting for old`siunitx` versions
Splines Mar 16, 2024
21f1eec
Fix shadowing warning message
paul019 Mar 16, 2024
b56af58
Add disclaimer to troubleshooting section
Splines Mar 16, 2024
cb5f173
Merge remote-tracking branch 'origin/value-wizard' into value-wizard
Splines Mar 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/actions/changed_files/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Why is this file in a subdirectory? Because GitHub Actions requires it to be :(
# see: https://github.com/orgs/community/discussions/26245#discussioncomment-5962450
name: "Get changed files"
description: "Checks out the code and returns the filenames of files that have changed in the pull request"

inputs:
file-extensions:
# for example: "\.py$" or something like "\.py$|\.py.myfile$"
description: "Regex expressions for grep to filter for specific files"
required: true

outputs:
changed-files:
description: "A space-separated list of the files that have changed in the pull request"
value: ${{ steps.get-changed-files.outputs.files }}

runs:
using: "composite"
steps:
# This has to be done in the main workflow, not in the action, because
# otherwise this reusable action is not available in the workflow.
# - name: "Checkout code (on a PR branch)"
# uses: actions/checkout@v4
# with:
# fetch-depth: 2 # to also fetch parent of PR

# Adapted from this great comment [1]. Git diff adapted from [2].
# "|| test $? = 1;" is used to ignore the exit code of grep when no files
# are found matching the pattern. For the "three dots" ... syntax, see [3].
#
# Resources:
# number [1] being most important
# [1] https://github.com/actions/checkout/issues/520#issuecomment-1167205721
# [2] https://robertfaldo.medium.com/commands-to-run-rubocop-and-specs-you-changed-in-your-branch-e6d2f2e4110b
# [3] https://community.atlassian.com/t5/Bitbucket-questions/Git-diff-show-different-files-than-PR-Pull-Request/qaq-p/2331786
- name: Get changed files
shell: bash
id: get-changed-files
run: |
files_pretty=$(git diff --name-only --diff-filter=ACMR -r HEAD^1...HEAD | egrep '${{inputs.file-extensions}}' || test $? = 1;)
printf "🎴 Changed files: \n$files_pretty"
echo "files=$(echo ${files_pretty} | xargs)" >> $GITHUB_OUTPUT
50 changes: 50 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Linting

# for "synchronize", see [1]
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

jobs:
pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2 # to also fetch parent of PR (used to get changed files)

- name: Get changed files
id: py-changed
uses: ./.github/actions/changed_files/
with:
file-extensions: \.py$

- name: Setup Python
if: ${{ steps.py-changed.outputs.changed-files != ''}}
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pipenv'

# see Caching [2]
- name: Install pipenv
if: ${{ steps.py-changed.outputs.changed-files != ''}}
run: pip install pipenv

- name: Install dependencies
if: ${{ steps.py-changed.outputs.changed-files != ''}}
run: pipenv install --dev

# For GitHub output format, see [3]
- name: Run Pylint
if: ${{ steps.py-changed.outputs.changed-files != ''}}
run: |
echo "🚨 Running Pylint version: $(pipenv run python3 -m pylint --version)"
pipenv run python3 -m pylint ${{ steps.py-changed.outputs.changed-files }}


# [1] https://github.com/orgs/community/discussions/26366
# [2] https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages
# [3] https://github.com/pylint-dev/pylint/issues/9443
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release package

on:
release:
types: [published]

jobs:
releasepypi:
# see https://docs.pypi.org/trusted-publishers/using-a-publisher/
# and https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives
name: Release to PyPI
runs-on: "ubuntu-latest"
environment: release
permissions:
id-token: write

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pipenv'

- name: Run tests (one last time before release)
run: |
pip install pipenv
pipenv install --dev
pipenv run pip3 install --editable .
pipenv run pytest tests/

- name: Install build tooling
run: python3 -m pip install --upgrade build

- name: Build distributions
run: python3 -m build

- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Testing

on:
push:
branches:
- main

# for "synchronize", see [1]
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

jobs:
pytest:
name: Pytest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pipenv'

- name: Install pipenv
run: pip install pipenv

- name: Install dependencies (including dev dependencies)
run: pipenv install --dev

- name: Install ResultWizard itself (as editable)
run: pipenv run pip3 install --editable .

- name: Run Pytest
run: pipenv run pytest tests/



# [1] https://github.com/orgs/community/discussions/26366
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.vscode/
/test/
*/__pycache__
__pycache__
*.tex
*.tex
*.egg-info
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"streetsidesoftware.code-spell-checker",
"ms-python.pylint",
"ms-python.black-formatter",
"littlefoxteam.vscode-python-test-adapter",
"hbenl.vscode-test-explorer"
]
}
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug test (only use for tests)",
"type": "python",
"request": "attach",
"console": "integratedTerminal",
"justMyCode": true,
"stopOnEntry": false,
"purpose": [
"debug-test"
]
}
]
}
87 changes: 87 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
//////////////////////////////////////
// Python (linting & formatting)
//////////////////////////////////////
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
},
"pylint.importStrategy": "fromEnvironment",
"python.analysis.typeCheckingMode": "basic",
"python.languageServer": "Pylance",
"python.analysis.completeFunctionParens": true,
"python.analysis.diagnosticSeverityOverrides": {
"reportGeneralTypeIssues": "warning",
"reportUndefinedVariable": "warning",
"reportOptionalMemberAccess": "warning"
},
// Python Tests
"pythonTestExplorer.testFramework": "pytest",
"testExplorer.codeLens": true,
"testExplorer.errorDecorationHover": true,
"python.testing.pytestArgs": [
"."
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
//////////////////////////////////////
// Files
//////////////////////////////////////
"files.exclude": {
"**/__pycache__/": true,
"**/*.egg-info/": true,
".pytest_cache/": true
},
//////////////////////////////////////
// Editor
//////////////////////////////////////
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 100, // toggle via Alt + Z shortcut
"editor.mouseWheelZoom": true,
"editor.rulers": [
{
"column": 80, // soft limit
"color": "#e5e5e5"
},
{
"column": 100, // hard limit
"color": "#c9c9c9"
}
],
//////////////////////////////////////
// Git
//////////////////////////////////////
"git.inputValidation": true,
"git.inputValidationSubjectLength": 50,
"git.inputValidationLength": 72,
//////////////////////////////////////
// Spell Checker
//////////////////////////////////////
"cSpell.words": [
"github",
"ifthen",
"ifthenelse",
"justfile",
"latexer",
"newcommand",
"normalsize",
"pipenv",
"pydantic",
"pylint",
"pytest",
"resultwizard",
"scriptsize",
"scriptstyle",
"sigfigs",
"siunitx",
"Stringifier",
"textbf",
"texttt",
"TLDR",
"uncert",
"usepackage"
]
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog of ResultWizard

TODO
68 changes: 68 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Development Guideline/Conventions/Installation

Just a dump for right now. In construction... Maybe a wiki would also be a good place for this.


## Checklist
Getting ready:
- [ ] GPG key setup to sign commits
- [ ] Recommended VSCode extensions installed (especially the formatter. It should automatically format on every save!)
- [ ] on branch `value-wizard` with latest commit pulled
- [ ] Work through the `Setup` section below (especially to install the necessary dependencies)
- [ ] Read the [`README.md`](https://github.com/paul019/ResultWizard/tree/value-wizard/src#code-structure) in the `src` folder (to get to know the code structure) & see our [feature list](https://github.com/paul019/ResultWizard/issues/16)

Verify that everything worked:
- [ ] try to run the tests, see the instructions in [`tests/playground.py`](./tests/playground.py)

Then start working on the code:
- [ ] search for "TODO"s in the code, they will guide you to the next steps
- [ ] document and append to `tests/playground.py` what we expect as user when using this library (we will use this as a reference to test the library later on)
- [ ] try to add doc-strings early on (in relevant places), so that I know what you are doing (and you know what I'm doing :))
- [ ] discuss when you want to restructure `domain` objects (e.g. `_Value`), e.g. if you are annoyed of having to deal with strings instead of floats (but I think with strings we are more flexible)


## Setup

- Install the recommended VSCode extensions. This includes `pylint` (Python linting) and `black` (Python formatting). VSCode is setup via the `settings.json` to format on save.

> [!Tip]
> I've specified recommended extensions, you can install them in VSCode by using [the "recommended" filter](https://code.visualstudio.com/docs/editor/extension-marketplace#_extensions-view-filter-and-commands).

- Install [pipenv](https://pipenv.pypa.io/en/latest/installation.html). I added this to my `.bashrc`:
```bash
alias python3=python3.11
export PATH="$PATH:~/.local/bin"
```
- Install the dependencies: `pipenv install`
- Type in `pipenv` to see available commands, e.g. `pipenv shell` etc.


## TODO
- Setup `.editorconfig` for non-VSCode users. At least provide very basic setup like max line length etc.
- A [`justfile`](https://github.com/casey/just) would also be beneficial.



## Testing ❌✅

As always, make sure you are in the `pipenv shell`.

Make sure you have all (dev) dependencies installed:

```
pipenv install -d
```

Then you can run the tests via the command line:

```
pytest
```

But with VSCode, you get direct integration into the **Test Explorer UI**. You will have to install the recommended extensions first. Then switch to the Testing tab and you will find the tests there. You can run them from there, jump to the file where they are defined and even start debugging them. You can also do the same via the code lens (it shows a little menu "Run | Debug | ..." over every test method) in the test files themselves. Try to set a breakpoint and debug it by clicking "Debug" in the code lens. While debugging, go the debug panel and see some variables there or enter one in the watch tab. Try to modify a test such that it fails and get to know where you see the error.

Also try adding `import pytest` as first line of a test file. Does it give you a warning? If so, you have selected the wrong VSCode Python interpreter. Choose the one provided by the pipenv virtual environment where all dependencies are installed.

Note that tests are also run on every commit via a GitHub action.

In order to learn how to write the tests with pytest, start with the [`Get Started` guide](https://docs.pytest.org/en/8.0.x/getting-started.html#create-your-first-test). Probably also relevant: ["How to use fixtures"](https://docs.pytest.org/en/8.0.x/how-to/fixtures.html). There are lots of [How-to guides](https://docs.pytest.org/en/8.0.x/how-to/index.html) available.
Loading