Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pytest fixtures: hg / git configurations to session scope#475

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tony merged 10 commits intomasterfrompytest-config
Oct 12, 2024

Conversation

@tony
Copy link
Member

@tonytony commentedOct 12, 2024
edited
Loading

Resolves#474

Problem

Issue#472 requires session-scoped fixtures.

Currently, we useset_home,gitconfig, andhgconfig tomonkeypatch.setenv$HOME, pointing it to a temporary directory with user-specific configuration files. This ensures all subsequentgit andhg commands automatically load these configurations.

However,monkeypatch.setenv doesn't work with function-scoped fixtures.

Improvement

❯ hyperfine \  --warmup 3 \  --runs 10 \  --prepare 'git checkout master' \  --command-name 'libvcs 0.31.0' \  'py.test' \  --prepare 'git checkout pytest-config' \  --command-name 'with improved hg/git config fixtures' \  'py.test'Benchmark 1: libvcs 0.31.0  Time (mean ± σ):     15.150 s ±  0.751 s    [User: 16.650 s, System: 4.720 s]  Range (min … max):   14.235 s … 16.741 s    10 runsBenchmark 2: with improved hg/git config fixtures  Time (mean ± σ):     15.014 s ±  0.307 s    [User: 17.246 s, System: 4.865 s]  Range (min … max):   14.458 s … 15.642 s    10 runsSummary  with improved hg/git config fixtures ran    1.01 ± 0.05 times faster than libvcs 0.31.0

Changes

pytest fixtures: Session-scopedhgconfig andgitconfig

These are now set byset_hgconfig andset_gitconfig, which setHGRCPATH andGIT_CONFIG, instead of overridingHOME.

@codecov
Copy link

codecovbot commentedOct 12, 2024
edited
Loading

Codecov Report

Attention: Patch coverage is94.44444% with2 lines in your changes missing coverage. Please review.

Project coverage is 64.52%. Comparing base(58a9247) to head(43eebcb).
Report is 11 commits behind head on master.

Files with missing linesPatch %Lines
src/libvcs/pytest_plugin.py88.23%1 Missing and 1 partial⚠️
Additional details and impacted files
@@            Coverage Diff             @@##           master     #475      +/-   ##==========================================+ Coverage   64.17%   64.52%   +0.34%==========================================  Files          40       40                Lines        3713     3721       +8       Branches      788      789       +1     ==========================================+ Hits         2383     2401      +18+ Misses        793      782      -11- Partials      537      538       +1

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

@tonytonyforce-pushed thepytest-config branch 3 times, most recently froma68d632 to3e4d41eCompareOctober 12, 2024 22:00
Fixed 2 errors:- src/libvcs/pytest_plugin.py:    1 × RET504 (unnecessary-assign)- tests/sync/test_svn.py:    1 × COM812 (missing-trailing-comma)
@tonytony merged commit7d6bc81 intomasterOct 12, 2024
6 checks passed
@tonytony deleted the pytest-config branchOctober 12, 2024 22:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Commands: Set configuration file (for tests)

2 participants

@tony

[8]ページ先頭

©2009-2025 Movatter.jp