diff --git a/test/test_0_basic.py b/test/test_0_basic.py index de663848..5bf16822 100644 --- a/test/test_0_basic.py +++ b/test/test_0_basic.py @@ -13,8 +13,8 @@ basic_project = CTemplateProject( ) -def test(tmpdir): - project_dir = str(tmpdir) +def test(tmp_path): + project_dir = tmp_path / 'project' basic_project.generate(project_dir) # build the wheels @@ -25,8 +25,8 @@ def test(tmpdir): assert set(actual_wheels) == set(expected_wheels) -def test_build_identifiers(tmpdir): - project_dir = str(tmpdir) +def test_build_identifiers(tmp_path): + project_dir = tmp_path / 'project' basic_project.generate(project_dir) # check that the number of expected wheels matches the number of build diff --git a/test/test_before_build.py b/test/test_before_build.py index db81bb6b..b1715238 100644 --- a/test/test_before_build.py +++ b/test/test_before_build.py @@ -28,8 +28,8 @@ project_with_before_build_asserts = CTemplateProject( ) -def test(tmpdir): - project_dir = str(tmpdir) +def test(tmp_path): + project_dir = tmp_path / 'project' project_with_before_build_asserts.generate(project_dir) # build the wheels diff --git a/test/test_before_test.py b/test/test_before_test.py index 46b3dce3..988f7b33 100644 --- a/test/test_before_test.py +++ b/test/test_before_test.py @@ -34,8 +34,8 @@ class TestBeforeTest(TestCase): ''' -def test(tmpdir): - project_dir = str(tmpdir) +def test(tmp_path): + project_dir = tmp_path / 'project' before_test_project.generate(project_dir) # build the wheels diff --git a/test/test_build_skip.py b/test/test_build_skip.py index f6cb123a..30bba181 100644 --- a/test/test_build_skip.py +++ b/test/test_build_skip.py @@ -14,8 +14,8 @@ project_with_skip_asserts = CTemplateProject( ) -def test(tmpdir): - project_dir = str(tmpdir) +def test(tmp_path): + project_dir = tmp_path / 'project' project_with_skip_asserts.generate(project_dir) # build the wheels diff --git a/test/test_cpp_standards.py b/test/test_cpp_standards.py index d5c5708a..c00c6791 100644 --- a/test/test_cpp_standards.py +++ b/test/test_cpp_standards.py @@ -73,9 +73,9 @@ MOD_INIT(spam) ''') -def test_cpp11(tmpdir): +def test_cpp11(tmp_path): # This test checks that the C++11 standard is supported - project_dir = str(tmpdir) + project_dir = tmp_path / 'project' project = cpp_template_project.copy() extra_compile_args = ['/std:c++11'] if utils.platform == 'windows' else ['-std=c++11'] @@ -93,9 +93,9 @@ def test_cpp11(tmpdir): assert set(actual_wheels) == set(expected_wheels) -def test_cpp14(tmpdir): +def test_cpp14(tmp_path): # This test checks that the C++14 standard is supported - project_dir = str(tmpdir) + project_dir = tmp_path / 'project' project = cpp_template_project.copy() extra_compile_args = ['/std:c++14'] if utils.platform == 'windows' else ['-std=c++14'] @@ -117,9 +117,9 @@ def test_cpp14(tmpdir): assert set(actual_wheels) == set(expected_wheels) -def test_cpp17(tmpdir): +def test_cpp17(tmp_path): # This test checks that the C++17 standard is supported - project_dir = str(tmpdir) + project_dir = tmp_path / 'project' project = cpp_template_project.copy() if utils.platform == 'windows': diff --git a/test/test_dependency_versions.py b/test/test_dependency_versions.py index c4f899ae..c290c971 100644 --- a/test/test_dependency_versions.py +++ b/test/test_dependency_versions.py @@ -51,11 +51,11 @@ def get_versions_from_constraint_file(constraint_file): @pytest.mark.parametrize('python_version', ['2.7', '3.5', '3.8']) -def test_pinned_versions(tmpdir, python_version): +def test_pinned_versions(tmp_path, python_version): if utils.platform == 'linux': pytest.skip('linux doesn\'t pin individual tool versions, it pins manylinux images instead') - project_dir = str(tmpdir) + project_dir = tmp_path / 'project' project_with_expected_version_checks.generate(project_dir) build_environment = {} @@ -108,7 +108,7 @@ def test_dependency_constraints_file(tmp_path, python_version): if utils.platform == 'linux': pytest.skip('linux doesn\'t pin individual tool versions, it pins manylinux images instead') - project_dir = str(tmp_path / 'project') + project_dir = tmp_path / 'project' project_with_expected_version_checks.generate(project_dir) tool_versions = { diff --git a/test/test_docker_images.py b/test/test_docker_images.py index c0254408..725779f2 100644 --- a/test/test_docker_images.py +++ b/test/test_docker_images.py @@ -20,13 +20,13 @@ dockcross_only_project = CTemplateProject( ) -def test(tmpdir): +def test(tmp_path): if utils.platform != 'linux': pytest.skip('the test is only relevant to the linux build') if platform.machine() not in ['x86_64', 'i686']: pytest.skip('this test is currently only possible on x86_64/i686 due to availability of alternative images') - project_dir = str(tmpdir) + project_dir = tmp_path / 'project' dockcross_only_project.generate(project_dir) actual_wheels = utils.cibuildwheel_run(project_dir, add_env={ diff --git a/test/test_environment.py b/test/test_environment.py index 5e4b9ee6..0d9eb103 100644 --- a/test/test_environment.py +++ b/test/test_environment.py @@ -27,8 +27,8 @@ project_with_environment_asserts = CTemplateProject( ) -def test(tmpdir): - project_dir = str(tmpdir) +def test(tmp_path): + project_dir = tmp_path / 'project' project_with_environment_asserts.generate(project_dir) # write some information into the CIBW_ENVIRONMENT, for expansion and @@ -45,8 +45,8 @@ def test(tmpdir): def test_overridden_path(tmp_path): - project_dir = str(tmp_path / 'project') - output_dir = str(tmp_path / 'output') + project_dir = tmp_path / 'project' + output_dir = tmp_path / 'output' CTemplateProject().generate(project_dir) # mess up PATH, somehow diff --git a/test/test_manylinuxXXXX_only.py b/test/test_manylinuxXXXX_only.py index 25aa6255..e3753ea9 100644 --- a/test/test_manylinuxXXXX_only.py +++ b/test/test_manylinuxXXXX_only.py @@ -33,14 +33,14 @@ project_with_manylinux_symbols = CTemplateProject( @pytest.mark.parametrize('manylinux_image', ['manylinux1', 'manylinux2010', 'manylinux2014']) -def test(manylinux_image, tmpdir): +def test(manylinux_image, tmp_path): if utils.platform != 'linux': pytest.skip('the docker test is only relevant to the linux build') elif platform.machine() not in ['x86_64', 'i686']: if manylinux_image in ['manylinux1', 'manylinux2010']: pytest.skip("manylinux1 and 2010 doesn't exist for non-x86 architectures") - project_dir = str(tmpdir) + project_dir = tmp_path / 'project' project_with_manylinux_symbols.generate(project_dir) # build the wheels diff --git a/test/test_ssl.py b/test/test_ssl.py index ae42fe77..eddb4074 100644 --- a/test/test_ssl.py +++ b/test/test_ssl.py @@ -22,10 +22,10 @@ project_with_ssl_tests = CTemplateProject( ) -def test(tmpdir): +def test(tmp_path): # this test checks that SSL is working in the build environment using # some checks in setup.py. - project_dir = str(tmpdir) + project_dir = tmp_path / 'project' project_with_ssl_tests.generate(project_dir) utils.cibuildwheel_run(project_dir) diff --git a/test/test_subdir_package.py b/test/test_subdir_package.py index 45a283aa..ebfebcf2 100644 --- a/test/test_subdir_package.py +++ b/test/test_subdir_package.py @@ -26,8 +26,8 @@ print('before_build.py executed!') ''' -def test(capfd, tmpdir): - project_dir = str(tmpdir) +def test(capfd, tmp_path): + project_dir = tmp_path / 'project' subdir_package_project.generate(project_dir) package_dir = os.path.join(project_dir, 'src', 'spam') diff --git a/test/test_testing.py b/test/test_testing.py index 37f1009f..ed60fded 100644 --- a/test/test_testing.py +++ b/test/test_testing.py @@ -25,8 +25,8 @@ class TestSpam(TestCase): ''' -def test(tmpdir): - project_dir = str(tmpdir) +def test(tmp_path): + project_dir = tmp_path / 'project' project_with_a_test.generate(project_dir) # build and test the wheels @@ -43,8 +43,8 @@ def test(tmpdir): assert set(actual_wheels) == set(expected_wheels) -def test_extras_require(tmpdir): - project_dir = str(tmpdir) +def test_extras_require(tmp_path): + project_dir = tmp_path / 'project' project_with_a_test.generate(project_dir) # build and test the wheels @@ -63,8 +63,8 @@ def test_extras_require(tmpdir): def test_failing_test(tmp_path): """Ensure a failing test causes cibuildwheel to error out and exit""" - project_dir = str(tmp_path / 'project') - output_dir = str(tmp_path / 'output') + project_dir = tmp_path / 'project' + output_dir = tmp_path / 'output' project_with_a_test.generate(project_dir) with pytest.raises(subprocess.CalledProcessError):