FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Refactor tests to remove the embedded git by SandrineP · Pull Request #32 · QuantStack/git2cpp · GitHub

Repository navigation

Refactor tests to remove the embedded git - #32

Merged
ianthomas23 merged 12 commits into
QuantStack:mainfrom
SandrineP:update_test
Aug 7, 2025
Merged

ianthomas23 merged 12 commits into
QuantStack:mainfrom
SandrineP:update_test

Conversation

Copy link
Copy Markdown
Collaborator

Refactor tests to remove the embedded git

SandrineP marked this pull request as draft August 4, 2025 09:33
SandrineP marked this pull request as ready for review August 7, 2025 09:29

ianthomas23 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just a couple of niggles, otherwise it looks like a big improvement.

Comment thread test/conftest.py Outdated
Comment thread test/conftest.py Outdated

Copy link
Copy Markdown
Member

I've thought of one possible improvement, but this is already a big enough PR so it could be done separately. Rather than use the hardcoded path test/data for the tests, we could instead use the pytest fixture tmp_path like we do at

def run_in_tmp_path(tmp_path):

Then each test will definitely be isolated from the other tests (each will have its own working_dir), and we won't have to cleanup after each test (e.g. removing the cloned xtl repo) as the temporary directories will automatically be cleaned for us.

Also I will create an issue for checking the returncode after each subprocess.run call in the tests.

Comment thread test/test_branch.py Outdated
p = subprocess.run(cmd, capture_output=True, cwd="test/data/status_data", text=True)
assert(p.stdout == '* main\n')
p = subprocess.run(cmd, capture_output=True, cwd=working_dir, text=True)
print()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ooh, empty print statement. I assume it isn't needed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I always forget a print left in my code somewhere...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

At least there were no swear words in it!

Copy link
Copy Markdown
Collaborator Author

I'll change to tmp_path in another PR as suggested.

ianthomas23 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks @SandrineP

ianthomas23 merged commit cca4403 into QuantStack:main Aug 7, 2025
SandrineP deleted the update_test branch September 1, 2025 12:00
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
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.

2 participants


Back | FazBrowse Home | New Git URL