You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#345 concerned an issue where git wasn't producing output quite as we expected. There are several tests in test_build.py and test_sdist.py which mock out the git command so they run independently of the system state. But it would be good to have an integration test which sets up a real git repository in a temporary directory, which we could add cases like #345 to.
This should cleanly skip itself if the git command is not available.
The text was updated successfully, but these errors were encountered:
git is isolated using the following environment, which are set globally
for the duration of that the new pytest fixture "tmp_git" is used:
GIT_CONFIG_GLOBAL
GIT_CONFIG_NOSYSTEM
HOME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_NAME
GIT_AUTHOR_DATE
GIT_COMMITTER_EMAIL
GIT_COMMITTER_NAME
GIT_COMMITTER_DATE
GIT_DIR and GIT_WORK_TREE could be set so that git can be called using
any method, but instead a git() function is added that uses git's -C
command-line option.
These were taken from one of git's test scripts:
https://github.com/git/git/blob/cefe983a320c03d7843ac78e73bd513a27806845/t/test-lib.sh#L454-L461
There are probably other ways git can be isolated.
The repository is initialized with an empty commit, but this isn't
strictly necessary, it just makes some of the possible tests require
less setup.
The new tmp_project fixture copies the sample module from
./test/samples/module1_toml to the project and commits the files.
A test is added for pypa#345 as an example of how this can be used.
A pytest marker is added so that tests with either "needgit" or
"needsgit" in the name are skipped if python can't find an executable
named "git".
The tox configuration is changed and another pytest marker is added so
that those tests can be run by themselves:
tox -- -m needgit
or skipped:
tox -- -m "not needgit"
Type hints were added to help with development, but aren't necessary to
keep.
#345 concerned an issue where git wasn't producing output quite as we expected. There are several tests in
test_build.py
andtest_sdist.py
which mock out the git command so they run independently of the system state. But it would be good to have an integration test which sets up a real git repository in a temporary directory, which we could add cases like #345 to.This should cleanly skip itself if the
git
command is not available.The text was updated successfully, but these errors were encountered: