diff options
| author | Ronny Pfannschmidt <opensource@ronnypfannschmidt.de> | 2019-12-14 00:23:40 +0100 |
|---|---|---|
| committer | Ronny Pfannschmidt <ronny.pfannschmidt@redhat.com> | 2020-05-01 22:26:47 +0200 |
| commit | b536c087bf5fc76febff44ea38315928beb0e168 (patch) | |
| tree | d1d668710f3b8c53d925076da9c2144a5e5809f7 /testing/test_git.py | |
| parent | c534e8a6dadb0b8830cc79203e62b6a1a966acaf (diff) | |
| download | setuptools-scm-workflows.tar.gz | |
add python testsworkflows
port testsuite to pathlib, and try to resolve windows short paths
trace git toplevel mismatch (observed on win32 name shortening)
exclude python2 on windows
remove the appveyor config, its broken
drop most travis envs that we have in github workflows now
add actions for creating egg artifacts/wheels/sdists
WIP: experiment with act
WIP: fix workflow typo
WIP: add missed runs-on
fix typoed excludes
fixup: upload actuall wheel/sdist in the build step
style fixes for the actions config
Diffstat (limited to 'testing/test_git.py')
| -rw-r--r-- | testing/test_git.py | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/testing/test_git.py b/testing/test_git.py index 8416571..ac45b5b 100644 --- a/testing/test_git.py +++ b/testing/test_git.py @@ -34,9 +34,10 @@ def test_parse_describe_output(given, tag, number, node, dirty): def test_root_relative_to(tmpdir, wd, monkeypatch): monkeypatch.delenv("SETUPTOOLS_SCM_DEBUG") - p = wd.cwd.ensure("sub/package", dir=1) - p.join("setup.py").write( - """from setuptools import setup + p = wd.cwd.joinpath("sub/package") + p.mkdir(parents=True) + p.joinpath("setup.py").write_text( + u"""from setuptools import setup setup(use_scm_version={"root": "../..", "relative_to": __file__}) """ @@ -159,8 +160,10 @@ def test_git_shallow_autocorrect(shallow_wd, recwarn): def test_find_files_stop_at_root_git(wd): wd.commit_testfile() - wd.cwd.ensure("project/setup.cfg") - assert integration.find_files(str(wd.cwd / "project")) == [] + project = wd.cwd / "project" + project.mkdir() + project.joinpath("setup.cfg").touch() + assert integration.find_files(str(project)) == [] @pytest.mark.issue(128) @@ -175,7 +178,7 @@ def test_alphanumeric_tags_match(wd): assert wd.version.startswith("0.1.dev1+g") -def test_git_archive_export_ignore(wd): +def test_git_archive_export_ignore(wd, monkeypatch): wd.write("test1.txt", "test") wd.write("test2.txt", "test") wd.write( @@ -186,28 +189,28 @@ def test_git_archive_export_ignore(wd): ) wd("git add test1.txt test2.txt") wd.commit() - with wd.cwd.as_cwd(): - assert integration.find_files(".") == [opj(".", "test1.txt")] + monkeypatch.chdir(wd.cwd) + assert integration.find_files(".") == [opj(".", "test1.txt")] @pytest.mark.issue(228) -def test_git_archive_subdirectory(wd): +def test_git_archive_subdirectory(wd, monkeypatch): wd("mkdir foobar") wd.write("foobar/test1.txt", "test") wd("git add foobar") wd.commit() - with wd.cwd.as_cwd(): - assert integration.find_files(".") == [opj(".", "foobar", "test1.txt")] + monkeypatch.chdir(wd.cwd) + assert integration.find_files(".") == [opj(".", "foobar", "test1.txt")] @pytest.mark.issue(251) -def test_git_archive_run_from_subdirectory(wd): +def test_git_archive_run_from_subdirectory(wd, monkeypatch): wd("mkdir foobar") wd.write("foobar/test1.txt", "test") wd("git add foobar") wd.commit() - with (wd.cwd / "foobar").as_cwd(): - assert integration.find_files(".") == [opj(".", "test1.txt")] + monkeypatch.chdir(wd.cwd / "foobar") + assert integration.find_files(".") == [opj(".", "test1.txt")] def test_git_feature_branch_increments_major(wd): |
