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

Unit tests #198

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Unit tests #198

wants to merge 5 commits into from

Conversation

zeptofine
Copy link
Collaborator

This introduces tests for some of the core parts of the project and some other things which are important to keep working for releases. NOTE i have not run these tests on windows so some things may not work yet

there is a file tests/config.py which show a few settings for testing

@zeptofine zeptofine added the enhancement New feature or request label Jan 3, 2025
@Victor-IX
Copy link
Owner

This is very nice!
I fixed test_get_args() for Windows. There was an issue with the root being hardcoded, and if your project was installed on another drive, it was failing. Also, the output string is using / and not \\ on Windows.

Is there a reason why you didn't add pytest to the pyproject.toml?

@zeptofine
Copy link
Collaborator Author

zeptofine commented Jan 3, 2025

There was an issue with the root being hardcoded, and if your project was installed on another drive, it was failing. Also, the output string is using / and not \\ on Windows.

Ah, thanks 👍🏽 i still dont entirely know when windows actually uses \\ and when it uses /

Is there a reason why you didn't add pytest to the pyproject.toml?

Well, I did as an optional dependency, since it's not really needed for the program to run

testing = [
"pytest-cov>=6.0.0",
"pytest>=8.3.4",
]

It can be activated using these commands IIRC

pip install ".[testing]"
# or 
pdm install -G testing
# or
uv sync --extra testing

@Victor-IX
Copy link
Owner

Ah, thanks 👍🏽 i still don't entirely know when windows actually uses \\ and when it uses /

From what I know, you can use both, but the standard way is with \\. I think there is no issue with both in PowerShell, but in CMD, / can cause issues. It is something we could standardize in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

2 participants