Repository: conan-io/conan
Pull request #18571 (2025-06-30 14:46:10)

fix: Typo


Patch:
diff --git a/conan/internal/cache/home_paths.py b/conan/internal/cache/home_paths.py
index 5674fbba1..6256f0503 100644
--- a/conan/internal/cache/home_paths.py
+++ b/conan/internal/cache/home_paths.py
@@ -20,8 +20,6 @@ class HomePaths:
     def global_conf_path(self):
         return os.path.join(self._home, "global.conf")
 
-    new_config_path = global_conf_path  # for not breaking tests, TODO to remove
-
     @property
     def deployers_path(self):
         deploy = os.path.join(self._home, _EXTENSIONS_FOLDER, "deploy")
diff --git a/conan/internal/default_settings.py b/conan/internal/default_settings.py
index 0cdbfc358..6fececc59 100644
--- a/conan/internal/default_settings.py
+++ b/conan/internal/default_settings.py
@@ -110,7 +110,7 @@ compiler:
                     "9", "9.1", "9.2", "9.3", "9.4", "9.5",
                     "10", "10.1", "10.2", "10.3", "10.4", "10.5",
                     "11", "11.1", "11.2", "11.3", "11.4", "11.5",
-                    "12", "12.1", "12.2", "12.3", "12.4",
+                    "12", "12.1", "12.2", "12.3", "12.4", "12.5",
                     "13", "13.1", "13.2", "13.3", "13.4",
                     "14", "14.1", "14.2", "14.3",
                     "15", "15.1"]
diff --git a/conan/internal/rest/remote_manager.py b/conan/internal/rest/remote_manager.py
index 98ca71c68..cd757647b 100644
--- a/conan/internal/rest/remote_manager.py
+++ b/conan/internal/rest/remote_manager.py
@@ -38,13 +38,11 @@ class RemoteManager:
     def upload_recipe(self, ref, files_to_upload, remote):
         assert isinstance(ref, RecipeReference)
         assert ref.revision, "upload_recipe requires RREV"
-        remote.invalidate_cache()
         self._call_remote(remote, "upload_recipe", ref, files_to_upload)
 
     def upload_package(self, pref, files_to_upload, remote):
         assert pref.ref.revision, "upload_package requires RREV"
         assert pref.revision, "upload_package requires PREV"
-        remote.invalidate_cache()
         self._call_remote(remote, "upload_package", pref, files_to_upload)
 
     def get_recipe(self, ref, remote, metadata=None):
@@ -206,15 +204,12 @@ class RemoteManager:
         return packages
 
     def remove_recipe(self, ref, remote):
-        remote.invalidate_cache()
         return self._call_remote(remote, "remove_recipe", ref)
 
     def remove_packages(self, prefs, remote):
-        remote.invalidate_cache()
         return self._call_remote(remote, "remove_packages", prefs)
 
     def remove_all_packages(self, ref, remote):
-        remote.invalidate_cache()
         return self._call_remote(remote, "remove_all_packages", ref)
 
     def authenticate(self, remote, name, password):
@@ -248,19 +243,10 @@ class RemoteManager:
 
         cached_method = remote._caching.setdefault("get_latest_package_reference", {})
         try:
-            result = cached_method[pref]
+            return cached_method[pref]
         except KeyError:
-            try:
-                result = self._call_remote(remote, "get_latest_package_reference", pref,
-                                           headers=headers)
-                cached_method[pref] = result
-                return result
-            except Exception as e:
-                cached_method[pref] = e
-                raise e
-        else:
-            if isinstance(result, Exception):
-                raise result
+            result = self._call_remote(remote, "get_latest_package_reference", pref, headers=headers)
+            cached_method[pref] = result
             return result
 
     def get_recipe_revision_reference(self, ref, remote) -> bool:
diff --git a/conan/tools/gnu/autotools.py b/conan/tools/gnu/autotools.py
index d25dfb905..d66dcdf60 100644
--- a/conan/tools/gnu/autotools.py
+++ b/conan/tools/gnu/autotools.py
@@ -57,7 +57,7 @@ class Autotools(object):
         cmd = '"{}" {}'.format(configure_cmd, self._configure_args)
         self._conanfile.run(cmd)
 
-    def make(self, target=None, args=None):
+    def make(self, target=None, args=None, makefile=None):
         """
         Call the make program.
 
@@ -66,6 +66,7 @@ class Autotools(object):
                        projects
         :param args: (Optional, Defaulted to ``None``): List of arguments to use for the
                      ``make`` call.
+        :param makefile: (Optional, Defaulted to ``None``): Allow specifying a custom makefile to use instead of default "Makefile"
         """
         make_program = self._conanfile.conf.get("tools.gnu:make_program",
                                                 default="mingw32-make" if self._use_win_mingw()
@@ -78,10 +79,12 @@ class Autotools(object):
             njobs = build_jobs(self._conanfile)
             if njobs:
                 jobs = "-j{}".format(njobs)
-        command = join_arguments([make_program, target, str_args, str_extra_args, jobs])
+        str_makefile = f"--file={makefile}" if makefile else None
+
+        command = join_arguments([make_program, str_makefile, target, str_args, str_extra_args, jobs])
         self._conanfile.run(command)
 
-    def install(self, args=None, target="install"):
+    def install(self, args=None, target="install", makefile=None):
         """
         This is just an "alias" of ``self.make(target="install")``
 
@@ -90,12 +93,13 @@ class Autotools(object):
                      is added to the call if the passed value is ``None``. See more information about
                      :ref:`tools.microsoft.unix_path() function<conan_tools_microsoft_unix_path>`
         :param target: (Optional, Defaulted to ``None``): Choose which target to install.
+        :param makefile: (Optional, Defaulted to ``None``): Allow specifying a custom makefile to use instead of default "Makefile"
         """
         args = args if args else []
         str_args = " ".join(args)
         if "DESTDIR=" not in str_args:
             args.insert(0, "DESTDIR={}".format(unix_path(self._conanfile, self._conanfile.package_folder)))
-        self.make(target=target, args=args)
+        self.make(target=target, args=args, makefile=makefile)
 
     def autoreconf(self, build_script_folder=None, args=None):
         """
diff --git a/conan/tools/premake/premake.py b/conan/tools/premake/premake.py
index 2d90af900..e123d31db 100644
--- a/conan/tools/premake/premake.py
+++ b/conan/tools/premake/premake.py
@@ -109,7 +109,8 @@ class Premake:
         :param msbuild_platform: ``str`` Specify the platform for the internal MSBuild generator (only used by ``MSBuild``).
         """
         if not self._premake_conan_toolchain.exists():
-            raise ConanException("Premake.build() method requires PrmakeToolchain to work properly")
+            raise ConanException("Premake.build() method requires PremakeToolchain to work properly")
+
         if self.action.startswith("vs"):
             msbuild = MSBuild(self._conanfile)
             if msbuild_platform:


Test patch:
diff --git a/test/functional/command/config_install_test.py b/test/functional/command/config_install_test.py
index fbab29d6d..c317bece8 100644
--- a/test/functional/command/config_install_test.py
+++ b/test/functional/command/config_install_test.py
@@ -587,7 +587,7 @@ class ConfigInstallSchedTest(unittest.TestCase):
         assert ".gitlab-conan" in client.cache_folder
         assert os.path.basename(client.cache_folder) == DEFAULT_CONAN_HOME
         client.run('config install "%s/.git" --type git' % self.folder)
-        conf = load(client.paths.new_config_path)
+        client.load_home("global.conf")  # check it is there
         dirs = os.listdir(client.cache_folder)
         assert ".git" not in dirs
 
diff --git a/test/functional/toolchains/cmake/test_cmake.py b/test/functional/toolchains/cmake/test_cmake.py
index d77aedbf9..4ba1fe1e0 100644
--- a/test/functional/toolchains/cmake/test_cmake.py
+++ b/test/functional/toolchains/cmake/test_cmake.py
@@ -11,7 +11,6 @@ from conan.test.assets.cmake import gen_cmakelists
 from conan.test.assets.sources import gen_function_cpp, gen_function_h
 from test.functional.utils import check_vs_runtime, check_exe_run
 from conan.test.utils.tools import TestClient
-from conan.internal.util.files import save
 
 
 @pytest.mark.tool("cmake", "3.15")
@@ -217,7 +216,7 @@ class WinTest(Base):
                     "build_type": build_type,
                     }
         options = {"shared": shared}
-        save(self.client.paths.new_config_path, "tools.build:jobs=1")
+        self.client.save_home({"global.conf": "tools.build:jobs=1"})
         self._run_build(settings, options)
         self.assertIn('cmake -G "Visual Studio 15 2017" '
                       '-DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake"', self.client.out)
@@ -472,7 +471,7 @@ def test_msvc_vs_versiontoolset():
                 "build_type": "Release",
                 }
     client = TestClient()
-    save(client.paths.new_config_path, "tools.microsoft.msbuild:vs_version=15")
+    client.save_home({"global.conf": "tools.microsoft.msbuild:vs_version=15"})
     conanfile = textwrap.dedent("""
             from conan import ConanFile
             from conan.tools.cmake import CMake
diff --git a/test/functional/toolchains/cmake/test_cmake_toolchain.py b/test/functional/toolchains/cmake/test_cmake_toolchain.py
index c0c0ebe7c..5e6b6936f 100644
--- a/test/functional/toolchains/cmake/test_cmake_toolchain.py
+++ b/test/functional/toolchains/cmake/test_cmake_toolchain.py
@@ -50,7 +50,7 @@ def test_cmake_toolchain_user_toolchain():
     client = TestClient(path_with_spaces=False)
     conanfile = GenConanfile().with_settings("os", "compiler", "build_type", "arch").\
         with_generator("CMakeToolchain")
-    save(client.paths.new_config_path, "tools.cmake.cmaketoolchain:user_toolchain+=mytoolchain.cmake")
+    client.save_home({"global.conf": "tools.cmake.cmaketoolchain:user_toolchain+=mytoolchain.cmake"})
 
     client.save({"conanfile.py": conanfile})
     client.run("install .")
@@ -62,7 +62,7 @@ def test_cmake_toolchain_custom_toolchain():
     client = TestClient(path_with_spaces=False)
     conanfile = GenConanfile().with_settings("os", "compiler", "build_type", "arch").\
         with_generator("CMakeToolchain")
-    save(client.paths.new_config_path, "tools.cmake.cmaketoolchain:toolchain_file=mytoolchain.cmake")
+    client.save_home({"global.conf": "tools.cmake.cmaketoolchain:toolchain_file=mytoolchain.cmake"})
 
     client.save({"conanfile.py": conanfile})
     client.run("install .")
@@ -1416,7 +1416,7 @@ def test_inject_user_toolchain():
     # Now test with the global.conf
     global_conf = 'tools.cmake.cmaketoolchain:user_toolchain=' \
                   '["{{conan_home_folder}}/my.cmake"]'
-    save(client.paths.new_config_path, global_conf)
+    client.save_home({"global.conf": global_conf})
     save(os.path.join(client.cache_folder, "my.cmake"), 'message(STATUS "IT WORKS!!!!")')
     client.run("build .")
     # The toolchain is found and can be used
diff --git a/test/functional/toolchains/env/test_virtualenv_powershell.py b/test/functional/toolchains/env/test_virtualenv_powershell.py
index 194bdaa83..25119d305 100644
--- a/test/functional/toolchains/env/test_virtualenv_powershell.py
+++ b/test/functional/toolchains/env/test_virtualenv_powershell.py
@@ -11,7 +11,6 @@ from conan.test.utils.mocks import ConanFileMock
 from conan.test.utils.test_files import temp_folder
 from conan.test.utils.tools import TestClient
 from conan.tools.env.environment import environment_wrap_command
-from conan.internal.util.files import save
 
 
 @pytest.fixture
@@ -30,7 +29,7 @@ def client():
     """
     client.save({"conanfile.py": conanfile})
     client.run("create .")
-    save(client.paths.new_config_path, "tools.env.virtualenv:powershell=powershell.exe\n")
+    client.save_home({"global.conf": "tools.env.virtualenv:powershell=powershell.exe\n"})
     return client
 
 
diff --git a/test/functional/toolchains/gnu/autotools/test_win_bash.py b/test/functional/toolchains/gnu/autotools/test_win_bash.py
index d184e1a8d..fca0f1c9c 100644
--- a/test/functional/toolchains/gnu/autotools/test_win_bash.py
+++ b/test/functional/toolchains/gnu/autotools/test_win_bash.py
@@ -10,7 +10,6 @@ from conan.test.assets.sources import gen_function_cpp
 from test.conftest import tools_locations
 from test.functional.utils import check_exe_run, check_vs_runtime
 from conan.test.utils.tools import TestClient
-from conan.internal.util.files import save
 
 
 @pytest.mark.skipif(platform.system() != "Windows", reason="Requires Windows")
@@ -157,10 +156,10 @@ def test_add_msys2_path_automatically():
     except KeyError:
         pytest.skip("msys2 path not defined")
 
-    save(client.paths.new_config_path, textwrap.dedent("""
+    client.save_home({"global.conf": textwrap.dedent("""
             tools.microsoft.bash:subsystem=msys2
             tools.microsoft.bash:path={}
-            """.format(bash_path)))
+            """.format(bash_path))})
 
     conanfile = textwrap.dedent("""
         from conan import ConanFile
@@ -276,7 +275,7 @@ def test_msys2_and_msbuild():
         """)
 
     # A minimal project is sufficient - here just copy the application file to another directory
-    my_vcxproj = """<?xml version="1.0" encoding="utf-8"?>
+    my_vcxproj = r"""<?xml version="1.0" encoding="utf-8"?>
         <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
         <ItemGroup Label="ProjectConfigurations">
         <ProjectConfiguration Include="Debug|Win32">
diff --git a/test/functional/tools/scm/test_git.py b/test/functional/tools/scm/test_git.py
index 89f3c9a1d..42d946f21 100644
--- a/test/functional/tools/scm/test_git.py
+++ b/test/functional/tools/scm/test_git.py
@@ -1301,7 +1301,7 @@ class TestGitTreelessRemote:
 
     def test_treeless_clone_with_parenthesis(self):
         """
-        Windows can use C:\Program Files (x86) path, which contains parenthesis.
+        Windows can use C:/Program Files (x86) path, which contains parenthesis.
         As the URL will have (fetch) or (push), get_remote_url() should be able to parse it.
         """
         repository = os.path.join(temp_folder(), "Program Files (x86)", "myrepo")
diff --git a/test/integration/build_requires/profile_build_requires_test.py b/test/integration/build_requires/profile_build_requires_test.py
index 946ce389f..03fd0b2be 100644
--- a/test/integration/build_requires/profile_build_requires_test.py
+++ b/test/integration/build_requires/profile_build_requires_test.py
@@ -1,198 +1,148 @@
 import os
 import platform
 import textwrap
-import unittest
+
+import pytest
 
 from conan.internal.paths import CONANFILE
 from conan.test.utils.tools import TestClient, GenConanfile
 
 
-tool_conanfile = """
-import os
-from conan import ConanFile
-from conan.tools.files import copy
-
-class tool(ConanFile):
-    name = "tool"
-    version = "0.1"
-    exports_sources = "mytool*"
-
-    def package(self):
-        copy(self, "mytool*", self.source_folder, self.package_folder)
-
-    def package_info(self):
-        self.buildenv_info.append_path("PATH", self.package_folder)
-"""
+class TestBuildRequires:
 
-lib_conanfile = """
-from conan import ConanFile
+    @pytest.fixture()
+    def client(self):
+        c = TestClient()
+        tool_conanfile = textwrap.dedent("""
+            import os
+            from conan import ConanFile
+            from conan.tools.files import copy
 
-class mylib(ConanFile):
-    name = "mylib"
-    version = "0.1"
+            class tool(ConanFile):
+                name = "tool"
+                version = "0.1"
+                exports_sources = "mytool*"
 
-    def build(self):
-        self.run("mytool")
-"""
+                def package(self):
+                    copy(self, "mytool*", self.source_folder, self.package_folder)
 
-profile = """
-[tool_requires]
-tool/0.1@lasote/stable
-nonexistingpattern*: sometool/1.2@user/channel
-"""
-
-profile2 = """
-[tool_requires]
-tool/0.1@lasote/stable
-nonexistingpattern*: sometool/1.2@user/channel
-"""
-
-
-class BuildRequiresTest(unittest.TestCase):
-
-    def _create(self, client):
+                def package_info(self):
+                    self.buildenv_info.append_path("PATH", self.package_folder)
+            """)
         name = "mytool.bat" if platform.system() == "Windows" else "mytool"
-        client.save({CONANFILE: tool_conanfile,
-                     name: "echo Hello World!"}, clean_first=True)
-        os.chmod(os.path.join(client.current_folder, name), 0o777)
-        client.run("export . --user=lasote --channel=stable")
-
-    def test_profile_requires(self):
+        c.save({CONANFILE: tool_conanfile,
+                name: "echo Hello World!"}, clean_first=True)
+        os.chmod(os.path.join(c.current_folder, name), 0o777)
+        c.run("export . --user=lasote --channel=stable")
+
+        lib_conanfile = textwrap.dedent("""
+            from conan import ConanFile
+
+            class mylib(ConanFile):
+                name = "mylib"
+                version = "0.1"
+
+                def build(self):
+                    self.run("mytool")
+            """)
+        profile = """
+            [tool_requires]
+            tool/0.1@lasote/stable
+            nonexistingpattern*: sometool/1.2@user/channel
+            """
+
+        profile2 = """
+            [tool_requires]
+            tool/0.1@lasote/stable
+            nonexistingpattern*: sometool/1.2@user/channel
+            """
+
+        test_conanfile = textwrap.dedent("""
+           from conan import ConanFile
+
+           class Testmylib(ConanFile):
+
+               def build(self):
+                   self.run("mytool")
+               def test(self):
+                   pass
+           """)
+        c.save({CONANFILE: lib_conanfile,
+                "test_package/conanfile.py": test_conanfile,
+                "profile.txt": profile,
+                "profile2.txt": profile2}, clean_first=True)
+        return c
+
+    def test_profile_requires(self, client):
         """
         cli -(tool-requires)-> tool/0.1
           \\--(requires)->mylib/0.1 -(tool_requires)->tool/0.1 (skipped)
         """
-        client = TestClient()
-        self._create(client)
-
-        client.save({CONANFILE: lib_conanfile,
-                     "profile.txt": profile,
-                     "profile2.txt": profile2}, clean_first=True)
         client.run("export . --user=lasote --channel=stable")
         client.run("install --requires=mylib/0.1@lasote/stable --profile ./profile.txt --build missing")
-        self.assertIn("Hello World!", client.out)
+        assert "Hello World!" in client.out
 
         client.run("install --requires=mylib/0.1@lasote/stable --profile ./profile2.txt --build='*'")
-        self.assertIn("Hello World!", client.out)
-
-    def test_profile_open_requires(self):
-        client = TestClient()
-        self._create(client)
-
-        client.save({CONANFILE: lib_conanfile,
-                     "profile.txt": profile}, clean_first=True)
+        assert "Hello World!" in client.out
 
+    def test_profile_open_requires(self, client):
         client.run("build . --profile ./profile.txt --build missing")
-        self.assertIn("Hello World!", client.out)
-
-    def test_build_mode_requires(self):
-        client = TestClient()
-        self._create(client)
-
-        client.save({CONANFILE: lib_conanfile,
-                     "profile.txt": profile}, clean_first=True)
+        assert "Hello World!" in client.out
 
+    def test_build_mode_requires(self, client):
         client.run("install . --profile ./profile.txt", assert_error=True)
-        self.assertIn("ERROR: Missing prebuilt package for 'tool/0.1@lasote/stable'", client.out)
+        assert "ERROR: Missing prebuilt package for 'tool/0.1@lasote/stable'" in client.out
         client.run("install . --profile ./profile.txt --build=Pythontool", assert_error=True)
-        self.assertIn("ERROR: Missing prebuilt package for 'tool/0.1@lasote/stable'", client.out)
+        assert "ERROR: Missing prebuilt package for 'tool/0.1@lasote/stable'" in client.out
         client.run("install . --profile ./profile.txt --build=tool/0.1*")
-        self.assertIn("tool/0.1@lasote/stable: Created package", client.out)
+        assert "tool/0.1@lasote/stable: Created package" in client.out
 
         # now remove packages, ensure --build=missing also creates them
         client.run('remove "*:*" -c')
         client.run("install . --profile ./profile.txt --build=missing")
-        self.assertIn("tool/0.1@lasote/stable: Created package", client.out)
+        assert "tool/0.1@lasote/stable: Created package" in client.out
 
-    def test_profile_test_requires(self):
-        client = TestClient()
-        self._create(client)
-
-        test_conanfile = """
-import os
-from conan import ConanFile, tools
-
-class Testmylib(ConanFile):
-    def requirements(self):
-        self.requires(self.tested_reference_str)
-
-    def build(self):
-        self.run("mytool")
-
-    def test(self):
-        pass
-        """
-        client.save({CONANFILE: lib_conanfile,
-                     "test_package/conanfile.py": test_conanfile,
-                     "profile.txt": profile,
-                     "profile2.txt": profile2}, clean_first=True)
-
-        client.run("create . --user=lasote --channel=stable --profile ./profile.txt --build missing")
-        self.assertEqual(2, str(client.out).splitlines().count("Hello World!"))
-
-    def test_consumer_patterns(self):
-        client = TestClient()
-        self._create(client)
+    def test_profile_test_requires(self, client):
+        client.run("create . --profile ./profile.txt --build missing")
+        assert 2 == str(client.out).splitlines().count("Hello World!")
 
-        test_conanfile = """
-import os
-from conan import ConanFile, tools
-
-class Testmylib(ConanFile):
-
-    def build(self):
-        self.run("mytool")
-    def test(self):
-        pass
-        """
-        lib_conanfile = """
-import os
-from conan import ConanFile, tools
-
-class mylib(ConanFile):
-    name = "mylib"
-    version = "0.1"
-
-
-"""
+    def test_consumer_patterns(self, client):
         profile_patterns = """
-[tool_requires]
-&: tool/0.1@lasote/stable
-nonexistingpattern*: sometool/1.2@user/channel
-"""
-        client.save({CONANFILE: lib_conanfile,
-                     "test_package/conanfile.py": test_conanfile,
-                     "profile.txt": profile_patterns}, clean_first=True)
-
-        client.run("create . --user=lasote --channel=stable --profile=./profile.txt --build=missing")
-        self.assertEqual(1, str(client.out).splitlines().count("Hello World!"))
+            [tool_requires]
+            &: tool/0.1@lasote/stable
+            nonexistingpattern*: sometool/1.2@user/channel
+            """
+        client.save({CONANFILE: GenConanfile("mylib", "0.1"),
+                     "profile.txt": profile_patterns})
+        client.run("create . --profile=./profile.txt --build=missing")
+        assert 1 == str(client.out).splitlines().count("Hello World!")
 
     def test_build_requires_options(self):
         client = TestClient()
         client.save({CONANFILE: GenConanfile("mytool", "0.1")})
         client.run("export . --user=lasote --channel=stable")
 
-        conanfile = """
-from conan import ConanFile, tools
-
-class mylib(ConanFile):
-    name = "mylib"
-    version = "0.1"
-    build_requires = "mytool/0.1@lasote/stable"
-    options = {"coverage": [True, False]}
-    def build(self):
-        self.output.info("Coverage %s" % self.options.coverage)
-"""
+        conanfile = textwrap.dedent("""
+            from conan import ConanFile
+
+            class mylib(ConanFile):
+                name = "mylib"
+                version = "0.1"
+                build_requires = "mytool/0.1@lasote/stable"
+                options = {"coverage": [True, False]}
+                def build(self):
+                    self.output.info("Coverage %s" % self.options.coverage)
+            """)
         client.save({CONANFILE: conanfile}, clean_first=True)
         client.run("build . -o mylib*:coverage=True --build missing")
         client.assert_listed_require({"mytool/0.1@lasote/stable": "Cache"}, build=True)
-        self.assertIn("conanfile.py (mylib/0.1): Coverage True", client.out)
+        assert "conanfile.py (mylib/0.1): Coverage True" in client.out
 
         client.save({CONANFILE: conanfile}, clean_first=True)
         client.run("build . -o coverage=True")
         client.assert_listed_require({"mytool/0.1@lasote/stable": "Cache"}, build=True)
-        self.assertIn("mytool/0.1@lasote/stable: Already installed!", client.out)
-        self.assertIn("conanfile.py (mylib/0.1): Coverage True", client.out)
+        assert "mytool/0.1@lasote/stable: Already installed!" in client.out
+        assert "conanfile.py (mylib/0.1): Coverage True" in client.out
 
 
 def test_consumer_patterns_loop_error():
diff --git a/test/integration/cache/download_cache_test.py b/test/integration/cache/download_cache_test.py
index 5850279c5..19029de5a 100644
--- a/test/integration/cache/download_cache_test.py
+++ b/test/integration/cache/download_cache_test.py
@@ -140,7 +140,7 @@ class TestDownloadCache:
         assert "some content 3" in client.load("myfile3.txt")
 
         # disabling cache will make it fail
-        save(client.paths.new_config_path, "")
+        client.save_home({"global.conf": ""})
         client.run("source .", assert_error=True)
         assert "ERROR: conanfile.py: Error in source() method, line 10" in client.out
         assert "Not found" in client.out
diff --git a/test/integration/command/export_pkg_test.py b/test/integration/command/export_pkg_test.py
index a30c60156..110acf1f0 100644
--- a/test/integration/command/export_pkg_test.py
+++ b/test/integration/command/export_pkg_test.py
@@ -3,7 +3,6 @@ import os
 import re
 
 import textwrap
-import unittest
 from textwrap import dedent
 
 from conan.internal.paths import CONANFILE
@@ -11,7 +10,7 @@ from conan.test.utils.tools import TestClient, GenConanfile
 from conan.internal.util.files import load
 
 
-class ExportPkgTest(unittest.TestCase):
+class TestExportPkg:
 
     def test_dont_touch_server(self):
         # https://github.com/conan-io/conan/issues/3432
@@ -34,22 +33,22 @@ class ExportPkgTest(unittest.TestCase):
         client.run("build pkga -bf=build")
         client.run("export-pkg pkga ")
         package_id = re.search(r"Packaging to (\S+)", str(client.out)).group(1)
-        self.assertIn(f"conanfile.py (pkga/0.1): Package '{package_id}' created", client.out)
+        assert f"conanfile.py (pkga/0.1): Package '{package_id}' created" in client.out
 
         # we can export-pkg without the dependencies binaries if we need to optimize
         client.run("remove pkgc*:* -c")
         client.run("remove pkgb*:* -c")
         client.run("export-pkg pkga --skip-binaries")
         package_id = re.search(r"Packaging to (\S+)", str(client.out)).group(1)
-        self.assertIn(f"conanfile.py (pkga/0.1): Package '{package_id}' created", client.out)
+        assert f"conanfile.py (pkga/0.1): Package '{package_id}' created" in client.out
 
     def test_package_folder_errors(self):
         # https://github.com/conan-io/conan/issues/2350
         client = TestClient()
         client.save({CONANFILE: GenConanfile()})
         client.run("export-pkg . --name=hello --version=0.1 --user=lasote --channel=stable")
-        self.assertIn("conanfile.py (hello/0.1@lasote/stable): package(): "
-                      "WARN: No files in this package!", client.out)
+        assert ("conanfile.py (hello/0.1@lasote/stable): package(): "
+                "WARN: No files in this package!") in client.out
 
     def test_options(self):
         # https://github.com/conan-io/conan/issues/2242
@@ -65,19 +64,19 @@ class ExportPkgTest(unittest.TestCase):
         client.save({CONANFILE: conanfile})
         client.run("export-pkg .")
         client.run("list hello/0.1:*")
-        self.assertIn("optionOne: True", client.out)
-        self.assertNotIn("optionOne: False", client.out)
-        self.assertNotIn("optionOne: 123", client.out)
+        assert "optionOne: True" in client.out
+        assert "optionOne: False" not in client.out
+        assert "optionOne: 123" not in client.out
         client.run("export-pkg . -o optionOne=False")
         client.run("list hello/0.1:*")
-        self.assertIn("optionOne: True", client.out)
-        self.assertIn("optionOne: False", client.out)
-        self.assertNotIn("optionOne: 123", client.out)
+        assert "optionOne: True" in client.out
+        assert "optionOne: False" in client.out
+        assert "optionOne: 123" not in client.out
         client.run("export-pkg . -o hello/*:optionOne=123")
         client.run("list hello/0.1:*")
-        self.assertIn("optionOne: True", client.out)
-        self.assertIn("optionOne: False", client.out)
-        self.assertIn("optionOne: 123", client.out)
+        assert "optionOne: True" in client.out
+        assert "optionOne: False" in client.out
+        assert "optionOne: 123" in client.out
 
     def test_profile_environment(self):
         # https://github.com/conan-io/conan/issues/4832
@@ -100,26 +99,25 @@ class ExportPkgTest(unittest.TestCase):
                      "myprofile": profile})
         client.run("export-pkg . --name=hello --version=0.1 --user=lasote --channel=stable "
                    " -pr=myprofile")
-        self.assertIn("conanfile.py (hello/0.1@lasote/stable): ENV-VALUE: MYCUSTOMVALUE!!!",
-                      client.out)
+        assert "conanfile.py (hello/0.1@lasote/stable): ENV-VALUE: MYCUSTOMVALUE!!!" in client.out
 
     def test_build_folders(self):
         client = TestClient()
-        conanfile = """
-import os
-from conan import ConanFile
-from conan.tools.files import save, copy
-class TestConan(ConanFile):
-    name = "hello"
-    version = "0.1"
-    settings = "os"
+        conanfile = textwrap.dedent("""
+            import os
+            from conan import ConanFile
+            from conan.tools.files import copy
+            class TestConan(ConanFile):
+                name = "hello"
+                version = "0.1"
+                settings = "os"
 
-    def package(self):
-        copy(self, "*.h", os.path.join(self.source_folder, "include"),
-             os.path.join(self.package_folder, "inc"))
-        copy(self, "*.lib", os.path.join(self.build_folder, "lib"),
-             os.path.join(self.package_folder, "lib"))
-"""
+                def package(self):
+                    copy(self, "*.h", os.path.join(self.source_folder, "include"),
+                         os.path.join(self.package_folder, "inc"))
+                    copy(self, "*.lib", os.path.join(self.build_folder, "lib"),
+                         os.path.join(self.package_folder, "lib"))
+            """)
         client.save({CONANFILE: conanfile,
                      "include/header.h": "//Windows header",
                      "include/header.txt": "",
@@ -131,26 +129,26 @@ class TestConan(ConanFile):
         assert "copy(pattern=*.lib) copied 1 files" in client.out
         package_folder = client.created_layout().package()
         inc = os.path.join(package_folder, "inc")
-        self.assertEqual(os.listdir(inc), ["header.h"])
-        self.assertEqual(load(os.path.join(inc, "header.h")), "//Windows header")
+        assert os.listdir(inc) == ["header.h"]
+        assert load(os.path.join(inc, "header.h")) == "//Windows header"
         lib = os.path.join(package_folder, "lib")
-        self.assertEqual(os.listdir(lib), ["hello.lib"])
-        self.assertEqual(load(os.path.join(lib, "hello.lib")), "My Lib")
+        assert os.listdir(lib) == ["hello.lib"]
+        assert load(os.path.join(lib, "hello.lib")) == "My Lib"
 
     def test_default_source_folder(self):
         client = TestClient()
-        conanfile = """
-import os
-from conan import ConanFile
-from conan.tools.files import copy
-class TestConan(ConanFile):
+        conanfile = textwrap.dedent("""
+            import os
+            from conan import ConanFile
+            from conan.tools.files import copy
+            class TestConan(ConanFile):
 
-    def package(self):
-        copy(self, "*.h", os.path.join(self.source_folder, "src"),
-             os.path.join(self.package_folder, "include"))
-        copy(self, "*.lib", self.build_folder, os.path.join(self.package_folder, "lib"),
-             keep_path=False)
-"""
+                def package(self):
+                    copy(self, "*.h", os.path.join(self.source_folder, "src"),
+                         os.path.join(self.package_folder, "include"))
+                    copy(self, "*.lib", self.build_folder, os.path.join(self.package_folder, "lib"),
+                         keep_path=False)
+            """)
         client.save({CONANFILE: conanfile,
                      "src/header.h": "contents",
                      "build/lib/hello.lib": "My Lib"})
@@ -159,32 +157,32 @@ class TestConan(ConanFile):
 
         package_folder = client.created_layout().package()
         header = os.path.join(package_folder, "include/header.h")
-        self.assertTrue(os.path.exists(header))
+        assert os.path.exists(header)
 
         hello_path = os.path.join(package_folder, "lib", "hello.lib")
-        self.assertTrue(os.path.exists(hello_path))
+        assert os.path.exists(hello_path)
 
     def test_build_source_folders(self):
         client = TestClient()
-        conanfile = """
-import os
-from conan import ConanFile
-from conan.tools.files import copy
-class TestConan(ConanFile):
-    settings = "os"
-    name = "hello"
-    version = "0.1"
+        conanfile = textwrap.dedent("""
+            import os
+            from conan import ConanFile
+            from conan.tools.files import copy
+            class TestConan(ConanFile):
+                settings = "os"
+                name = "hello"
+                version = "0.1"
 
-    def layout(self):
-        self.folders.build = "build"
-        self.folders.source = "src"
+                def layout(self):
+                    self.folders.build = "build"
+                    self.folders.source = "src"
 
-    def package(self):
-        copy(self, "*.h", os.path.join(self.source_folder, "include"),
-             os.path.join(self.package_folder, "inc"))
-        copy(self, "*.lib", os.path.join(self.build_folder, "lib"),
-             os.path.join(self.package_folder, "lib"))
-"""
+                def package(self):
+                    copy(self, "*.h", os.path.join(self.source_folder, "include"),
+                         os.path.join(self.package_folder, "inc"))
+                    copy(self, "*.lib", os.path.join(self.build_folder, "lib"),
+                         os.path.join(self.package_folder, "lib"))
+            """)
         client.save({CONANFILE: conanfile,
                      "src/include/header.h": "//Windows header",
                      "src/include/header.txt": "",
@@ -195,52 +193,52 @@ class TestConan(ConanFile):
 
         package_folder = client.created_layout().package()
         inc = os.path.join(package_folder, "inc")
-        self.assertEqual(os.listdir(inc), ["header.h"])
-        self.assertEqual(load(os.path.join(inc, "header.h")), "//Windows header")
+        assert os.listdir(inc) == ["header.h"]
+        assert load(os.path.join(inc, "header.h")) == "//Windows header"
         lib = os.path.join(package_folder, "lib")
-        self.assertEqual(os.listdir(lib), ["hello.lib"])
-        self.assertEqual(load(os.path.join(lib, "hello.lib")), "My Lib")
+        assert os.listdir(lib) == ["hello.lib"]
+        assert load(os.path.join(lib, "hello.lib")) == "My Lib"
 
     def test_partial_references(self):
         client = TestClient()
-        conanfile = """
-from conan import ConanFile
-from conan.tools.files import copy
-class TestConan(ConanFile):
-    name = "hello"
-    version = "0.1"
-    settings = "os"
+        conanfile = textwrap.dedent("""
+            from conan import ConanFile
+            from conan.tools.files import copy
+            class TestConan(ConanFile):
+                name = "hello"
+                version = "0.1"
+                settings = "os"
 
-    def package(self):
-        copy(self, "*", self.source_folder, self.package_folder)
-"""
+                def package(self):
+                    copy(self, "*", self.source_folder, self.package_folder)
+            """)
         # Partial reference is ok
         client.save({CONANFILE: conanfile, "file.txt": "txt contents"})
         client.run("export-pkg . --user=conan --channel=stable")
-        self.assertIn("conanfile.py (hello/0.1@conan/stable): package(): "
-                      "Packaged 1 '.txt' file: file.txt", client.out)
+        assert ("conanfile.py (hello/0.1@conan/stable): package(): "
+                "Packaged 1 '.txt' file: file.txt") in client.out
 
         # Specify different name or version is not working
         client.run("export-pkg . --name=lib", assert_error=True)
-        self.assertIn("ERROR: Package recipe with name lib!=hello", client.out)
+        assert "ERROR: Package recipe with name lib!=hello" in client.out
 
         client.run("export-pkg . --version=1.1", assert_error=True)
-        self.assertIn("ERROR: Package recipe with version 1.1!=0.1", client.out)
+        assert "ERROR: Package recipe with version 1.1!=0.1" in client.out
 
-        conanfile = """
-from conan import ConanFile
-from conan.tools.files import copy
-class TestConan(ConanFile):
-    settings = "os"
+        conanfile = textwrap.dedent("""
+            from conan import ConanFile
+            from conan.tools.files import copy
+            class TestConan(ConanFile):
+                settings = "os"
 
-    def package(self):
-        copy(self, "*", self.source_folder, self.package_folder)
-"""
+                def package(self):
+                    copy(self, "*", self.source_folder, self.package_folder)
+            """)
         # Partial reference is ok
         client.save({CONANFILE: conanfile, "file.txt": "txt contents"})
         client.run("export-pkg . --name=anyname --version=1.222 --user=conan --channel=stable")
-        self.assertIn("conanfile.py (anyname/1.222@conan/stable): package(): "
-                      "Packaged 1 '.txt' file: file.txt", client.out)
+        assert ("conanfile.py (anyname/1.222@conan/stable): package(): "
+                "Packaged 1 '.txt' file: file.txt") in client.out
 
     def test_with_deps(self):
         client = TestClient()
@@ -265,20 +263,16 @@ class TestConan(ConanFile):
         client.run("export-pkg . --name=hello1 --version=0.1 --user=lasote --channel=stable %s"
                    % settings)
 
-        # consumer
-        consumer = """
-from conan import ConanFile
-class TestConan(ConanFile):
-    requires = "hello1/0.1@lasote/stable"
-    settings = "os", "build_type"
-"""
+        consumer = (GenConanfile().with_requires("hello1/0.1@lasote/stable")
+                    .with_settings("os", "build_type"))
+
         client.save({CONANFILE: consumer}, clean_first=True)
         client.run("install conanfile.py -g CMakeDeps")
-        self.assertIn("hello/0.1@lasote/stable: Already installed!", client.out)
-        self.assertIn("hello1/0.1@lasote/stable: Already installed!", client.out)
+        assert "hello/0.1@lasote/stable: Already installed!" in client.out
+        assert "hello1/0.1@lasote/stable: Already installed!" in client.out
 
         cmakeinfo = client.load("hello1-release-data.cmake")
-        self.assertIn("set(hello1_LIBS_RELEASE mycoollib)", cmakeinfo)
+        assert "set(hello1_LIBS_RELEASE mycoollib)" in cmakeinfo
 
     def test_export_pkg_version_type(self):
         client = TestClient(light=True)
@@ -318,23 +312,24 @@ class TestConan(ConanFile):
 
     def test_export_pkg_no_ref(self):
         client = TestClient()
-        conanfile = """import os
-from conan import ConanFile
-from conan.tools.files import copy
-class TestConan(ConanFile):
-    name = "hello"
-    version = "0.1"
+        conanfile = textwrap.dedent("""
+            import os
+            from conan import ConanFile
+            from conan.tools.files import copy
+            class TestConan(ConanFile):
+                name = "hello"
+                version = "0.1"
 
-    def package(self):
-        copy(self, "*.h", os.path.join(self.source_folder, "src"),
-             os.path.join(self.package_folder, "include"))
-"""
+                def package(self):
+                    copy(self, "*.h", os.path.join(self.source_folder, "src"),
+                         os.path.join(self.package_folder, "include"))
+            """)
         client.save({CONANFILE: conanfile,
                      "src/header.h": "contents"})
         client.run("export-pkg . -s os=Windows")
         package_folder = client.created_layout().package()
         header = os.path.join(package_folder, "include/header.h")
-        self.assertTrue(os.path.exists(header))
+        assert os.path.exists(header)
 
 
 def test_build_policy_never():
diff --git a/test/integration/command/remove_test.py b/test/integration/command/remove_test.py
index b92eca6e5..76081fa47 100644
--- a/test/integration/command/remove_test.py
+++ b/test/integration/command/remove_test.py
@@ -1,7 +1,6 @@
 import json
 import os
 import shutil
-import unittest
 
 import pytest
 
@@ -9,24 +8,9 @@ from conan.api.conan_api import ConanAPI
 from conan.internal.errors import NotFoundException
 from conan.api.model import PkgReference
 from conan.api.model import RecipeReference
-from conan.test.utils.tools import NO_SETTINGS_PACKAGE_ID, TestClient, TestServer, GenConanfile
+from conan.test.utils.tools import NO_SETTINGS_PACKAGE_ID, TestClient, GenConanfile
 from conan.test.utils.env import environment_update
 
-conaninfo = '''
-[settings]
-    arch=x64
-    os=Windows
-    compiler=Visual Studio
-    compiler.version=8.%s
-[options]
-    use_Qt=True
-[full_requires]
-  hello2/0.1@lasote/stable:11111
-  OpenSSL/2.10@lasote/testing:2222
-  HelloInfo1/0.45@myuser/testing:33333
-[recipe_revision]
-'''
-
 
 class TestRemoveWithoutUserChannel:
 
@@ -53,7 +37,6 @@ class TestRemoveWithoutUserChannel:
             assert "Removed recipe and all binaries" in client.out  # Output it printed for dry-run
         else:
             assert "Removed recipe and all binaries" not in client.out
-        print()
 
     @pytest.mark.artifactory_ready
     def test_remote(self):
@@ -82,79 +65,53 @@ class TestRemoveWithoutUserChannel:
         assert "Unable to find 'lib/1.0' in remotes" in client.out
 
 
-class RemovePackageRevisionsTest(unittest.TestCase):
-
-    NO_SETTINGS_RREF = "4d670581ccb765839f2239cc8dff8fbd"
-
-    def setUp(self):
-        self.test_server = TestServer(users={"admin": "password"},
-                                      write_permissions=[("foobar/0.1@*/*", "admin")])
-        servers = {"default": self.test_server}
-        self.client = TestClient(servers=servers, inputs=["admin", "password"])
-        ref = RecipeReference.loads(f"foobar/0.1@user/testing#{self.NO_SETTINGS_RREF}")
-        self.pref = PkgReference(ref, NO_SETTINGS_PACKAGE_ID, "0ba8627bd47edc3a501e8f0eb9a79e5e")
+class TestRemovePackageRevisions:
 
-    def test_remove_local_package_id_argument(self):
+    @pytest.mark.artifactory_ready
+    def test_remove_package_revision(self):
         """ Remove package ID based on recipe revision. The package must be deleted, but
             the recipe must be preserved
-            Package ID is a separated argument: <package>#<rref> -p <pkgid>
-        """
-        self.client.save({"conanfile.py": GenConanfile()})
-        self.client.run("create . --name=foobar --version=0.1 --user=user --channel=testing")
-        assert self.client.package_exists(self.pref)
-
-        self.client.run("remove -c foobar/0.1@user/testing#{}:{}"
-                        .format(self.NO_SETTINGS_RREF, NO_SETTINGS_PACKAGE_ID))
-        assert not self.client.package_exists(self.pref)
-
-    def test_remove_local_package_id_reference(self):
-        """ Remove package ID based on recipe revision. The package must be deleted, but
-            the recipe must be preserved.
-            Package ID is part of package reference: <package>#<rref>:<pkgid>
-        """
-        self.client.save({"conanfile.py": GenConanfile()})
-        self.client.run("create . --name=foobar --version=0.1 --user=user --channel=testing")
-        assert self.client.package_exists(self.pref)
-
-        self.client.run("remove -c foobar/0.1@user/testing#{}:{}"
-                        .format(self.NO_SETTINGS_RREF, NO_SETTINGS_PACKAGE_ID))
-        assert not self.client.package_exists(self.pref)
-
-    @pytest.mark.artifactory_ready
-    def test_remove_remote_package_id_reference(self):
-        """ Remove remote package ID based on recipe revision. The package must be deleted, but
-            the recipe must be preserved.
-            Package ID is part of package reference: <package>#<rref>:<pkgid>
         """
-        self.client.save({"conanfile.py": GenConanfile()})
-        self.client.run("create . --name=foobar --version=0.1 --user=user --channel=testing")
-        self.client.run("upload foobar/0.1@user/testing -r default -c")
-        self.client.run("remove -c foobar/0.1@user/testing#{}:{}"
-                        .format(self.NO_SETTINGS_RREF, NO_SETTINGS_PACKAGE_ID))
-        assert not self.client.package_exists(self.pref)
-        self.client.run("remove -c foobar/0.1@user/testing#{}:{} -r default"
-                        .format(self.NO_SETTINGS_RREF, NO_SETTINGS_PACKAGE_ID))
-        assert not self.client.package_exists(self.pref)
+        ref = RecipeReference.loads("foobar/0.1@user/testing#4d670581ccb765839f2239cc8dff8fbd")
+        pref_arg = PkgReference(ref, NO_SETTINGS_PACKAGE_ID)
+        pref = PkgReference(ref, NO_SETTINGS_PACKAGE_ID, "0ba8627bd47edc3a501e8f0eb9a79e5e")
+        c = TestClient(light=True, default_server_user=True)
+        c.save({"conanfile.py": GenConanfile()})
+        c.run("create . --name=foobar --version=0.1 --user=user --channel=testing")
+        assert c.package_exists(pref)
+        c.run("upload * -r default -c")
+        c.run(f"list {ref}:*")
+        assert NO_SETTINGS_PACKAGE_ID in c.out
+
+        # remove from cache
+        c.run(f"remove -c {pref_arg.repr_notime()}")
+        assert not c.package_exists(pref)
+
+        # remove From server
+        c.run(f"remove -c {pref_arg.repr_notime()} -r=default")
+        c.run(f"list {ref}:*")
+        assert NO_SETTINGS_PACKAGE_ID not in c.out
 
     @pytest.mark.artifactory_ready
     def test_remove_all_packages_but_the_recipe_at_remote(self):
         """ Remove all the packages but not the recipe in a remote
         """
-        self.client.save({"conanfile.py": GenConanfile("foobar", "0.1").with_settings("arch")})
-        self.client.run("create . --user=user --channel=testing")
-        self.client.run("create . --user=user --channel=testing -s arch=x86")
-        self.client.run("upload foobar/0.1@user/testing -r default -c")
-        ref = self.client.cache.get_latest_recipe_reference(
-               RecipeReference.loads("foobar/0.1@user/testing"))
-        self.client.run("list foobar/0.1@user/testing#{}:* -r default".format(ref.revision))
-        default_arch = self.client.get_default_host_profile().settings['arch']
-        self.assertIn(f"arch: {default_arch}", self.client.out)
-        self.assertIn("arch: x86", self.client.out)
-
-        self.client.run("remove -c foobar/0.1@user/testing:* -r default")
-        self.client.run("search foobar/0.1@user/testing -r default")
-        self.assertNotIn(f"arch: {default_arch}", self.client.out)
-        self.assertNotIn("arch: x86", self.client.out)
+        c = TestClient(default_server_user=True)
+        c.save({"conanfile.py": GenConanfile("foobar", "0.1").with_settings("arch")})
+        c.run("create . --user=user --channel=testing -s arch=x86_64")
+        c.run("create . --user=user --channel=testing -s arch=x86")
+        c.run("upload * -r default -c")
+
+        c.run("list *:* -r default")
+        assert "foobar/0.1@user/testing" in c.out
+        assert "arch: x86_64" in c.out
+        assert "arch: x86" in  c.out
+
+        c.run("remove -c foobar/0.1@user/testing:* -r default")
+        c.run("list *:* -r default")
+        assert "foobar/0.1@user/testing" in c.out
+        assert "arch: x86_64" not in c.out
+        assert "arch: x86" not in c.out
 
 
 # populated packages of bar
diff --git a/test/integration/command/source_test.py b/test/integration/command/source_test.py
index 92fbc708e..cb9abeb25 100644
--- a/test/integration/command/source_test.py
+++ b/test/integration/command/source_test.py
@@ -9,7 +9,6 @@ import pytest
 from conan.internal.paths import CONANFILE
 from conan.test.assets.genconanfile import GenConanfile
 from conan.test.utils.tools import TestClient, TestServer
-from conan.internal.util.files import save
 
 
 class SourceTest(unittest.TestCase):
@@ -153,11 +152,11 @@ class ConanLib(ConanFile):
             from conan.tools.files import save, load
 
             class ConanLib(ConanFile):
-                
+
                 def layout(self):
                     self.folders.root = ".."
                     self.folders.source = "src"
-                
+
                 def source(self):
                     self.output.info(f"In the source() method the Source folder is: {self.source_folder}")
                     save(self, "source_file.c", "conent")
@@ -168,9 +167,9 @@ class ConanLib(ConanFile):
             ''')
         client = TestClient(light=True)
         client.save({CONANFILE: conanfile})
-        
+
         client.run("source .")
-        # The build method will fail if source() and build() don't 
+        # The build method will fail if source() and build() don't
         # both use the correct source_folder
         client.run("build .")
         assert "conanfile.py: Calling build()" in client.out  # doesn't fail
@@ -279,7 +278,7 @@ class TestSourceWithoutDefaultProfile:
     def client(self):
         c = TestClient()
         # The ``source()`` should still receive necessary configuration
-        save(c.paths.new_config_path, "tools.files.download:retry=MYCACHE")
+        c.save_home({"global.conf": "tools.files.download:retry=MYCACHE"})
         # Make sure we don't have default profile
         os.remove(os.path.join(c.cache_folder, "profiles", "default"))
         return c
diff --git a/test/integration/command/test_package_test.py b/test/integration/command/test_package_test.py
index d55f46f46..a48c1f1e0 100644
--- a/test/integration/command/test_package_test.py
+++ b/test/integration/command/test_package_test.py
@@ -1,7 +1,6 @@
 import json
 import os
 import textwrap
-import unittest
 
 from conan.api.model import RecipeReference
 from conan.internal.paths import CONANFILE
@@ -9,14 +8,14 @@ from conan.test.utils.tools import NO_SETTINGS_PACKAGE_ID, TestClient, GenConanf
 from conan.internal.util.files import load
 
 
-class TestPackageTest(unittest.TestCase):
+class TestPackageTest:
 
     def test_basic(self):
         client = TestClient()
-        client.save({CONANFILE: GenConanfile().with_name("hello").with_version("0.1"),
+        client.save({CONANFILE: GenConanfile("hello", "0.1"),
                      "test_package/conanfile.py": GenConanfile().with_test("pass")})
         client.run("create . --user=lasote --channel=stable")
-        self.assertIn("hello/0.1@lasote/stable: Created package", client.out)
+        assert "hello/0.1@lasote/stable: Created package" in client.out
 
     def test_basic_json(self):
         client = TestClient()
@@ -34,18 +33,18 @@ class TestPackageTest(unittest.TestCase):
         client.run("create . --user=lasote --channel=stable")
         client.run("test test_package hello/0.1@lasote/stable")
 
-        self.assertNotIn("Exporting package recipe", client.out)
-        self.assertNotIn("Forced build from source", client.out)
-        self.assertNotIn("Package '%s' created" % NO_SETTINGS_PACKAGE_ID, client.out)
-        self.assertNotIn("Forced build from source", client.out)
-        self.assertIn("hello/0.1@lasote/stable: Already installed!", client.out)
+        assert "Exporting package recipe" not in client.out
+        assert "Forced build from source" not in client.out
+        assert "Package '%s' created" % NO_SETTINGS_PACKAGE_ID not in client.out
+        assert "Forced build from source" not in client.out
+        assert "hello/0.1@lasote/stable: Already installed!" in client.out
 
         client.save({"test_package/conanfile.py": test_conanfile}, clean_first=True)
         client.run("test test_package hello/0.1@lasote/stable")
-        self.assertNotIn("hello/0.1@lasote/stable: Configuring sources", client.out)
-        self.assertNotIn("hello/0.1@lasote/stable: Created package", client.out)
-        self.assertIn("hello/0.1@lasote/stable: Already installed!", client.out)
-        self.assertIn("hello/0.1@lasote/stable (test package): Running test()", client.out)
+        assert "hello/0.1@lasote/stable: Configuring sources" not in client.out
+        assert "hello/0.1@lasote/stable: Created package" not in client.out
+        assert "hello/0.1@lasote/stable: Already installed!" in client.out
+        assert "hello/0.1@lasote/stable (test package): Running test()" in client.out
 
     def test_wrong_version(self):
         test_conanfile = GenConanfile().with_test("pass").with_require("hello/0.2@user/cc")
@@ -66,11 +65,11 @@ class TestPackageTest(unittest.TestCase):
         client.save({CONANFILE: GenConanfile().with_name("hello").with_version("0.1"),
                      "test_package/conanfile.py": test_conanfile})
         client.run("create . --user=user --channel=channel")
-        self.assertIn("hello/0.1@user/channel: Created package", client.out)
+        assert "hello/0.1@user/channel: Created package" in client.out
 
         # explicit override of user/channel works
         client.run("create . --user=lasote --channel=stable")
-        self.assertIn("hello/0.1@lasote/stable: Created package", client.out)
+        assert "hello/0.1@lasote/stable: Created package" in client.out
 
     def test_test_with_path_errors(self):
         client = TestClient()
@@ -79,15 +78,13 @@ class TestPackageTest(unittest.TestCase):
         # Path with conanfile.txt
         client.run("test conanfile.txt other/0.2@user2/channel2", assert_error=True)
 
-        self.assertIn("A conanfile.py is needed, %s is not acceptable"
-                      % os.path.join(client.current_folder, "conanfile.txt"),
-                      client.out)
+        assert ("A conanfile.py is needed, %s is not acceptable"
+                % os.path.join(client.current_folder, "conanfile.txt") in client.out)
 
         # Path with wrong conanfile path
         client.run("test not_real_dir/conanfile.py other/0.2@user2/channel2", assert_error=True)
-        self.assertIn("Conanfile not found at %s"
-                      % os.path.join(client.current_folder, "not_real_dir", "conanfile.py"),
-                      client.out)
+        assert ("Conanfile not found at %s"
+                % os.path.join(client.current_folder, "not_real_dir", "conanfile.py") in client.out)
 
     def test_check_version(self):
         client = TestClient()
@@ -116,9 +113,9 @@ class TestPackageTest(unittest.TestCase):
         client.save({"conanfile.py": conanfile,
                      "test_package/conanfile.py": test_conanfile})
         client.run("create . --name=hello --version=0.1")
-        self.assertIn("hello/0.1: BUILD Dep VERSION 1.1", client.out)
-        self.assertIn("hello/0.1 (test package): BUILD HELLO VERSION 0.1", client.out)
-        self.assertIn("hello/0.1 (test package): TEST HELLO VERSION 0.1", client.out)
+        assert "hello/0.1: BUILD Dep VERSION 1.1" in client.out
+        assert "hello/0.1 (test package): BUILD HELLO VERSION 0.1" in client.out
+        assert "hello/0.1 (test package): TEST HELLO VERSION 0.1" in client.out
 
 
 class TestPackageBuild:
@@ -181,7 +178,7 @@ class TestPackageBuild:
                                test_package=True)
 
 
-class ConanTestTest(unittest.TestCase):
+class TestConanTestTest:
 
     def test_partial_reference(self):
         # Create two packages to test with the same test
@@ -213,7 +210,7 @@ class HelloTestConan(ConanFile):
     def test(self):
         self.output.warning("Tested ok!")
 ''', "hello/0.1@conan/stable")
-        self.assertIn("Tested ok!", client.out)
+        assert "Tested ok!" in client.out
 
     def test_test_package_env(self):
         client = TestClient()
@@ -283,17 +280,14 @@ class HelloReuseConan(ConanFile):
         ref = RecipeReference.loads("hello/0.1@lasote/stable")
         client.run(f"test test {str(ref)}")
         pref = client.get_latest_package_reference(ref, NO_SETTINGS_PACKAGE_ID)
-        self.assertEqual("Hello FindCmake",
-                         load(os.path.join(client.get_latest_pkg_layout(pref).package(), "FindXXX.cmake")))
+        assert "Hello FindCmake" == load(os.path.join(client.get_latest_pkg_layout(pref).package(), "FindXXX.cmake"))
         client.save({"FindXXX.cmake": "Bye FindCmake"})
         client.run(f"test test {str(ref)}")  # Test do not rebuild the package
         pref = client.get_latest_package_reference(ref, NO_SETTINGS_PACKAGE_ID)
-        self.assertEqual("Hello FindCmake",
-                         load(os.path.join(client.get_latest_pkg_layout(pref).package(), "FindXXX.cmake")))
+        assert "Hello FindCmake" == load(os.path.join(client.get_latest_pkg_layout(pref).package(), "FindXXX.cmake"))
         client.run("create . --user=lasote --channel=stable")  # create rebuild the package
         pref = client.get_latest_package_reference(ref, NO_SETTINGS_PACKAGE_ID)
-        self.assertEqual("Bye FindCmake",
-                         load(os.path.join(client.get_latest_pkg_layout(pref).package(), "FindXXX.cmake")))
+        assert "Bye FindCmake" == load(os.path.join(client.get_latest_pkg_layout(pref).package(), "FindXXX.cmake"))
 
 
 def test_no_reference_in_test_package():
diff --git a/test/integration/conan_v2/test_legacy_cpp_info.py b/test/integration/conan_v2/test_legacy_cpp_info.py
index c0cad673b..6d841423b 100644
--- a/test/integration/conan_v2/test_legacy_cpp_info.py
+++ b/test/integration/conan_v2/test_legacy_cpp_info.py
@@ -36,7 +36,7 @@ def test_legacy_names_filenames():
     for name in ["cpp_info.names", "cpp_info.filenames", "env_info", "user_info", "cpp_info.build_modules"]:
         assert f"WARN: deprecated:     '{name}' used in: pkg/1.0" in c.out
 
-    save(c.paths.new_config_path, 'core:skip_warnings=["deprecated"]')
+    c.save_home({"global.conf": 'core:skip_warnings=["deprecated"]'})
     c.run("create .")
     for name in ["cpp_info.names", "cpp_info.filenames", "env_info", "user_info",
                  "cpp_info.build_modules"]:
diff --git a/test/integration/configuration/conf/test_conf.py b/test/integration/configuration/conf/test_conf.py
index 35b3be231..5b5c3b3a2 100644
--- a/test/integration/configuration/conf/test_conf.py
+++ b/test/integration/configuration/conf/test_conf.py
@@ -9,7 +9,7 @@ from conan import conan_version
 from conan.internal.api.detect import detect_api
 from conan.test.assets.genconanfile import GenConanfile
 from conan.test.utils.test_files import temp_folder
-from conan.internal.util.files import save, load
+from conan.internal.util.files import save
 from conan.test.utils.tools import TestClient
 
 
@@ -94,7 +94,7 @@ def test_composition_conan_conf(client):
         tools.microsoft.msbuild:vs_version=Slow
         tools.cmake.cmaketoolchain:generator=Extra
         """)
-    save(client.paths.new_config_path, conf)
+    client.save_home({"global.conf": conf})
     profile = textwrap.dedent("""\
         [conf]
         tools.build:verbosity=quiet
@@ -135,7 +135,7 @@ def test_new_config_file(client):
         user.mycompany.myhelper:myconfig=myvalue
         *:tools.cmake.cmaketoolchain:generator=X
         """)
-    save(client.paths.new_config_path, conf)
+    client.save_home({"global.conf": conf})
     client.run("install .")
     assert "tools.build:verbosity$quiet" in client.out
     assert "user.mycompany.myhelper:myconfig$myvalue" in client.out
@@ -148,7 +148,7 @@ def test_new_config_file(client):
             *:tools.cmake.cmaketoolchain:generator=X
             cache:read_only=True
             """)
-    save(client.paths.new_config_path, conf)
+    client.save_home({"global.conf": conf})
     client.run("install .", assert_error=True)
     assert "[conf] 'cache:read_only' does not exist in configuration list" in client.out
 
@@ -159,7 +159,7 @@ def test_new_config_file_required_version():
     conf = textwrap.dedent("""\
         core:required_conan_version=>=2.0
         """)
-    save(client.paths.new_config_path, conf)
+    client.save_home({"global.conf": conf})
     client.run("install .", assert_error=True)
     assert ("Current Conan version (1.26.0) does not satisfy the defined one (>=2.0)"
             in client.out)
@@ -170,7 +170,7 @@ def test_composition_conan_conf_overwritten_by_cli_arg(client):
         tools.build:verbosity=quiet
         tools.microsoft.msbuild:max_cpu_count=Slow
         """)
-    save(client.paths.new_config_path, conf)
+    client.save_home({"global.conf": conf})
     profile = textwrap.dedent("""\
         [conf]
         tools.build:verbosity=quiet
@@ -196,7 +196,7 @@ def test_composition_conan_conf_different_data_types_by_cli_arg(client):
     conf = textwrap.dedent("""\
         tools.build:cflags=["-Wall"]
         """)
-    save(client.paths.new_config_path, conf)
+    client.save_home({"global.conf": conf})
     client.run('install . -c "tools.build:cflags+=[\'-Werror\']" '
                '-c "tools.microsoft.msbuildtoolchain:compile_options={\'ExceptionHandling\': \'Async\'}"')
 
@@ -205,10 +205,10 @@ def test_composition_conan_conf_different_data_types_by_cli_arg(client):
 
 
 def test_jinja_global_conf(client):
-    save(client.paths.new_config_path, "user.mycompany:parallel = {{os.cpu_count()/2}}\n"
-                                       "user.mycompany:other = {{platform.system()}}\n"
-                                       "user.mycompany:dist = {{distro.id() if distro else '42'}}\n"
-                                       "user.conan:version = {{conan_version}}-{{conan_version>0.1}}")
+    client.save_home({"global.conf": "user.mycompany:parallel = {{os.cpu_count()/2}}\n"
+                                     "user.mycompany:other = {{platform.system()}}\n"
+                                     "user.mycompany:dist = {{distro.id() if distro else '42'}}\n"
+                                     "user.conan:version = {{conan_version}}-{{conan_version>0.1}}"})
     client.run("install .")
     assert "user.mycompany:parallel={}".format(os.cpu_count()/2) in client.out
     assert "user.mycompany:other={}".format(platform.system()) in client.out
@@ -230,7 +230,7 @@ def test_jinja_global_conf_include(client):
         {% set myvar = 42 %}
         user.mycompany:parallel = {{myvar}}
         """)
-    save(client.paths.new_config_path, global_conf)
+    client.save_home({"global.conf": global_conf})
     save(os.path.join(client.cache_folder, "user_global.conf"), user_global_conf)
     client.run("install .")
     assert "user.mycompany:parallel=42" in client.out
@@ -240,7 +240,7 @@ def test_jinja_global_conf_include(client):
 def test_jinja_global_conf_paths():
     c = TestClient()
     global_conf = 'user.mycompany:myfile = {{os.path.join(conan_home_folder, "myfile")}}'
-    save(c.paths.new_config_path, global_conf)
+    c.save_home({"global.conf": global_conf})
     c.run("config show *")
     cache_folder = c.cache_folder.replace("\\", "/")
     assert f"user.mycompany:myfile: {os.path.join(cache_folder, 'myfile')}" in c.out
@@ -255,7 +255,7 @@ def test_profile_detect_os_arch():
         user.myteam:myconf2={{detect_api.detect_arch()}}
         """)
 
-    save(c.paths.new_config_path, global_conf)
+    c.save_home({"global.conf": global_conf})
     c.run("config show *")
     _os = detect_api.detect_os()
     _arch = detect_api.detect_arch()
@@ -317,7 +317,7 @@ def test_nonexisting_conf():
 
 def test_nonexisting_conf_global_conf():
     c = TestClient()
-    save(c.paths.new_config_path, "tools.unknown:conf=value")
+    c.save_home({"global.conf":  "tools.unknown:conf=value"})
     c.save({"conanfile.txt": ""})
     c.run("install . ", assert_error=True)
     assert "ERROR: [conf] 'tools.unknown:conf' does not exist in configuration" in c.out
@@ -326,7 +326,7 @@ def test_nonexisting_conf_global_conf():
 def test_global_conf_auto_created():
     c = TestClient()
     c.run("config list")  # all commands will trigger
-    global_conf = load(c.paths.new_config_path)
+    global_conf = c.load_home("global.conf")
     assert "# core:non_interactive = True" in global_conf
 
 
@@ -372,7 +372,7 @@ def test_build_test_consumer_only():
                 def generate(self):
                     self.output.info(f'SKIP-TEST: {self.conf.get("tools.build:skip_test")}')
             """)
-    save(c.paths.new_config_path, "tools.build:skip_test=True\n&:tools.build:skip_test=False")
+    c.save_home({"global.conf": "tools.build:skip_test=True\n&:tools.build:skip_test=False"})
     c.save({"dep/conanfile.py": dep,
             "pkg/conanfile.py": pkg,
             "pkg/test_package/conanfile.py": GenConanfile().with_test("pass")})
@@ -409,7 +409,7 @@ def test_conf_should_be_immutable():
             def generate(self):
                 self.output.info(f'user.myteam:myconf: {self.conf.get("user.myteam:myconf")}')
         """)
-    save(c.paths.new_config_path, 'user.myteam:myconf=["root_value"]')
+    c.save_home({"global.conf": 'user.myteam:myconf=["root_value"]'})
     c.save({"dep/conanfile.py": dep,
             "pkg/conanfile.py": pkg})
     c.run("create dep")
@@ -429,7 +429,7 @@ def test_especial_strings_fail():
         user.mycompany:myfunct = re.search
         user.mycompany:mydict = {1: 're', 2: 'fnmatch'}
         """)
-    save(c.paths.new_config_path, global_conf)
+    c.save_home({"global.conf": global_conf})
     c.run("config show *")
     assert "user.mycompany:myfile: re" in c.out
     assert "user.mycompany:myother: fnmatch" in c.out
diff --git a/test/integration/configuration/default_profile_test.py b/test/integration/configuration/default_profile_test.py
index 2184201b4..7c0cbc652 100644
--- a/test/integration/configuration/default_profile_test.py
+++ b/test/integration/configuration/default_profile_test.py
@@ -45,7 +45,7 @@ class MyConanfile(ConanFile):
         default_profile_path = os.path.join(tmp, "myprofile")
         save(default_profile_path, "[buildenv]\nValue1=A")
         client = TestClient()
-        save(client.paths.new_config_path, "core:default_profile={}".format(default_profile_path))
+        client.save_home({"global.conf": "core:default_profile={}".format(default_profile_path)})
 
         client.save({CONANFILE: br})
         client.run("export . --user=lasote --channel=stable")
@@ -54,7 +54,7 @@ class MyConanfile(ConanFile):
         # Now use a name, in the default profile folder
         os.unlink(default_profile_path)
         save(os.path.join(client.paths.profiles_path, "other"), "[buildenv]\nValue1=A")
-        save(client.paths.new_config_path, "core:default_profile=other")
+        client.save_home({"global.conf": "core:default_profile=other"})
         client.save({CONANFILE: br})
         client.run("export . --user=lasote --channel=stable")
         client.run('install --requires=mylib/0.1@lasote/stable --build="*"')
@@ -153,7 +153,7 @@ def test_conf_default_two_profiles():
         core:default_profile=mydefault
         core:default_build_profile=mydefault_build
         """)
-    save(client.paths.new_config_path, global_conf)
+    client.save_home({"global.conf": global_conf})
     client.save({"conanfile.txt": ""})
     client.run("install .")
     assert "Profile host:" in client.out
diff --git a/test/integration/configuration/proxies_conf_test.py b/test/integration/configuration/proxies_conf_test.py
index f794555a8..867cf7d8b 100644
--- a/test/integration/configuration/proxies_conf_test.py
+++ b/test/integration/configuration/proxies_conf_test.py
@@ -5,7 +5,6 @@ from requests import Response
 
 from conan.test.utils.tools import TestClient, TestRequester
 from conan.test.utils.env import environment_update
-from conan.internal.util.files import save
 
 
 class TestProxiesConfTest:
@@ -22,7 +21,7 @@ class TestProxiesConfTest:
                 return resp
 
         client = TestClient(requester_class=MyHttpRequester)
-        save(client.paths.new_config_path, 'core.net.http:proxies = {"myproxykey": "myvalue"}')
+        client.save_home({"global.conf": 'core.net.http:proxies = {"myproxykey": "myvalue"}'})
         conanfile = textwrap.dedent("""
             from conan import ConanFile
             from conan.tools.files import download
@@ -50,9 +49,9 @@ class TestProxiesConfTest:
                 return resp
 
         client = TestClient(requester_class=MyHttpRequester)
-        save(client.paths.new_config_path,
+        client.save_home({"global.conf":
              'core.net.http:no_proxy_match = ["MyExcludedUrl*", "*otherexcluded_one*"]\n'
-             'core.net.http:proxies = {"http": "value"}')
+             'core.net.http:proxies = {"http": "value"}'})
         for url in ("**otherexcluded_one***", "MyUrl", "MyExcludedUrl***", "**MyExcludedUrl***"):
             conanfile = textwrap.dedent("""
                 from conan import ConanFile
@@ -128,7 +127,7 @@ class TestProxiesConfTest:
                 return resp
 
         client = TestClient(requester_class=MyHttpRequester)
-        save(client.paths.new_config_path, 'core.net.http:clean_system_proxy = True')
+        client.save_home({"global.conf": 'core.net.http:clean_system_proxy = True'})
 
         with environment_update({"http_proxy": "my_system_proxy"}):
             client.save({"conanfile.py": conanfile})
diff --git a/test/integration/graph/test_platform_requires.py b/test/integration/graph/test_platform_requires.py
index bb56b26f7..2d60277f9 100644
--- a/test/integration/graph/test_platform_requires.py
+++ b/test/integration/graph/test_platform_requires.py
@@ -6,7 +6,6 @@ import pytest
 
 from conan.test.assets.genconanfile import GenConanfile
 from conan.test.utils.tools import TestClient
-from conan.internal.util.files import save
 
 
 class TestPlatformRequires:
@@ -225,7 +224,7 @@ class TestPackageID:
         or package_id
         """
         client = TestClient(light=True)
-        save(client.paths.new_config_path, f"core.package_id:default_unknown_mode={package_id_mode}")
+        client.save_home({"global.conf": f"core.package_id:default_unknown_mode={package_id_mode}"})
         client.save({"conanfile.py": GenConanfile("pkg", "1.0").with_requires("dep/1.0"),
                      "profile": "[platform_requires]\ndep/1.0"})
         client.run("create . -pr=profile")
@@ -236,7 +235,8 @@ class TestPackageID:
         Changing the platform_requires revision affects consumers if package_revision_mode=recipe_revision
         """
         client = TestClient(light=True)
-        save(client.paths.new_config_path, "core.package_id:default_unknown_mode=recipe_revision_mode")
+        client.save_home({"global.conf":
+                              "core.package_id:default_unknown_mode=recipe_revision_mode"})
         client.save({"conanfile.py": GenConanfile("pkg", "1.0").with_requires("dep/1.0"),
                      "profile": "[platform_requires]\ndep/1.0#r1",
                      "profile2": "[platform_requires]\ndep/1.0#r2"})
@@ -256,7 +256,7 @@ class TestPackageID:
         platform_requires do not have settings or package_id, so it is ignored
         """
         client = TestClient()
-        save(client.paths.new_config_path, "core.package_id:default_unknown_mode=full_package_mode")
+        client.save_home({"global.conf": "core.package_id:default_unknown_mode=full_package_mode"})
         client.save({"conanfile.py": GenConanfile("pkg", "1.0").with_requires("dep/1.0"),
                      "profile": "[platform_requires]\ndep/1.0"})
         client.run("create . -pr=profile -s os=Linux")
diff --git a/test/integration/graph/test_system_tools.py b/test/integration/graph/test_system_tools.py
index 12568cb58..04e8ff364 100644
--- a/test/integration/graph/test_system_tools.py
+++ b/test/integration/graph/test_system_tools.py
@@ -225,7 +225,7 @@ class TestPackageID:
         or package_id
         """
         client = TestClient(light=True)
-        save(client.paths.new_config_path, f"core.package_id:default_build_mode={package_id_mode}")
+        client.save_home({"global.conf": f"core.package_id:default_build_mode={package_id_mode}"})
         client.save({"conanfile.py": GenConanfile("pkg", "1.0").with_tool_requires("dep/1.0"),
                      "profile": "[platform_tool_requires]\ndep/1.0"})
         client.run("create . -pr=profile")
@@ -236,7 +236,7 @@ class TestPackageID:
         Changing the system_tool_require revision affects consumers if package_revision_mode=recipe_revision
         """
         client = TestClient(light=True)
-        save(client.paths.new_config_path, "core.package_id:default_build_mode=recipe_revision_mode")
+        client.save_home({"global.conf": "core.package_id:default_build_mode=recipe_revision_mode"})
         client.save({"conanfile.py": GenConanfile("pkg", "1.0").with_tool_requires("dep/1.0"),
                      "profile": "[platform_tool_requires]\ndep/1.0#r1",
                      "profile2": "[platform_tool_requires]\ndep/1.0#r2"})
diff --git a/test/integration/metadata/test_metadata_commands.py b/test/integration/metadata/test_metadata_commands.py
index a36b30a2d..e9c91f55e 100644
--- a/test/integration/metadata/test_metadata_commands.py
+++ b/test/integration/metadata/test_metadata_commands.py
@@ -151,7 +151,7 @@ class TestMetadataCommands:
         c2 = TestClient(servers=c.servers)
         tmp_folder = temp_folder()
         # MOST important part: activate cache
-        save(c2.paths.new_config_path, f"core.download:download_cache={tmp_folder}\n")
+        c2.save_home({"global.conf": f"core.download:download_cache={tmp_folder}\n"})
 
         # download package and metadata
         c2.run("download pkg/0.1 -r=default --metadata=*")
diff --git a/test/integration/package_id/compatible_test.py b/test/integration/package_id/compatible_test.py
index f3c16db38..b224f2f84 100644
--- a/test/integration/package_id/compatible_test.py
+++ b/test/integration/package_id/compatible_test.py
@@ -2,7 +2,6 @@ import json
 import textwrap
 
 from conan.test.utils.tools import TestClient, GenConanfile
-from conan.internal.util.files import save
 
 
 class TestCompatibleIDsTest:
@@ -137,8 +136,8 @@ class TestCompatibleIDsTest:
             compiler.version=4.9
             compiler.libcxx=libstdc++
             """)
-        save(client.paths.new_config_path,
-             "core.package_id:default_unknown_mode=recipe_revision_mode")
+        client.save_home({"global.conf":
+                              "core.package_id:default_unknown_mode=recipe_revision_mode"})
         client.save({"conanfile.py": conanfile,
                      "myprofile": profile})
         # Create package with gcc 4.8
diff --git a/test/integration/package_id/python_requires_package_id_test.py b/test/integration/package_id/python_requires_package_id_test.py
index bd81cf478..a0312a7f3 100644
--- a/test/integration/package_id/python_requires_package_id_test.py
+++ b/test/integration/package_id/python_requires_package_id_test.py
@@ -3,7 +3,6 @@ import textwrap
 import pytest
 
 from conan.test.utils.tools import TestClient, GenConanfile
-from conan.internal.util.files import save
 
 
 PKG_ID_1 = "47b42eaf657374a3d040394f03961b66c53bda5e"
@@ -48,7 +47,7 @@ class TestPythonRequiresPackageID:
 
     def test_change_mode_conf(self):
         # change the policy in conan.conf
-        save(self.client2.paths.new_config_path, "core.package_id:default_python_mode=patch_mode")
+        self.client2.save_home({"global.conf": "core.package_id:default_python_mode=patch_mode"})
         self.client2.run("create . --name=pkg --version=0.1")
         assert "tool/1.1.1" in self.client2.out
         self.client2.assert_listed_binary({"pkg/0.1": (PKG_ID_1, "Build")})
@@ -61,8 +60,7 @@ class TestPythonRequiresPackageID:
 
     def test_unrelated_conf(self):
         # change the policy in conan.conf
-        save(self.client2.paths.new_config_path,
-             "core.package_id:default_python_mode=unrelated_mode")
+        self.client2.save_home({"global.conf": "core.package_id:default_python_mode=unrelated_mode"})
         self.client2.run("create . --name=pkg --version=0.1")
         assert "tool/1.1.1" in self.client2.out
         pkg_id = "da39a3ee5e6b4b0d3255bfef95601890afd80709"
@@ -97,7 +95,7 @@ class TestPythonRequiresPackageID:
 
 def test_python_requires_for_build_requires():
     client = TestClient()
-    save(client.paths.new_config_path, "core.package_id:default_python_mode=full_version_mode")
+    client.save_home({"global.conf": "core.package_id:default_python_mode=full_version_mode"})
     client.save({"conanfile.py": GenConanfile()})
     client.run("create . --name=tool --version=1.1.1")
 
diff --git a/test/integration/package_id/test_config_package_id.py b/test/integration/package_id/test_config_package_id.py
index 63889750d..da4b8c64d 100644
--- a/test/integration/package_id/test_config_package_id.py
+++ b/test/integration/package_id/test_config_package_id.py
@@ -57,7 +57,7 @@ def test_config_package_id_clear(config_version, mode, result):
 
 def test_recipe_revision_mode():
     clienta = TestClient()
-    save(clienta.paths.new_config_path, "core.package_id:default_unknown_mode=recipe_revision_mode")
+    clienta.save_home({"global.conf": "core.package_id:default_unknown_mode=recipe_revision_mode"})
 
     clienta.save({"conanfile.py": GenConanfile()})
     clienta.run("create . --name=liba --version=0.1 --user=user --channel=testing")
diff --git a/test/integration/package_id/test_package_id_test_requires.py b/test/integration/package_id/test_package_id_test_requires.py
index 54529ee11..7e3b750e8 100644
--- a/test/integration/package_id/test_package_id_test_requires.py
+++ b/test/integration/package_id/test_package_id_test_requires.py
@@ -1,7 +1,6 @@
 import pytest
 
 from conan.test.utils.tools import GenConanfile, TestClient
-from conan.internal.util.files import save
 
 
 @pytest.mark.parametrize("build_mode", [None, "patch_mode"])
@@ -11,7 +10,7 @@ def test_package_id_not_affected_test_requires(build_mode):
     """
     c = TestClient()
     if build_mode is not None:
-        save(c.paths.new_config_path, "core.package_id:default_build_mode={build_mode}")
+        c.save_home({"global.conf": f"core.package_id:default_build_mode={build_mode}"})
     c.save({"gtest/conanfile.py": GenConanfile("gtest", "1.0"),
             "engine/conanfile.py": GenConanfile("engine", "1.0").with_test_requires("gtest/1.0")})
     c.run("create gtest")
diff --git a/test/integration/package_id/test_validate.py b/test/integration/package_id/test_validate.py
index 0b1c71753..0ca8ac916 100644
--- a/test/integration/package_id/test_validate.py
+++ b/test/integration/package_id/test_validate.py
@@ -336,7 +336,7 @@ class TestValidate:
 
     def test_validate_package_id_mode(self):
         client = TestClient()
-        save(client.paths.new_config_path, "core.package_id:default_unknown_mode=full_package_mode")
+        client.save_home({"global.conf": "core.package_id:default_unknown_mode=full_package_mode"})
         conanfile = textwrap.dedent("""
           from conan import ConanFile
           from conan.errors import ConanInvalidConfiguration
diff --git a/test/integration/package_id/transitive_header_only_test.py b/test/integration/package_id/transitive_header_only_test.py
index 9368c90f2..a5399801c 100644
--- a/test/integration/package_id/transitive_header_only_test.py
+++ b/test/integration/package_id/transitive_header_only_test.py
@@ -7,7 +7,7 @@ class TestTransitiveIds:
     def test_transitive_library(self):
         # https://github.com/conan-io/conan/issues/6450
         client = TestClient(light=True)
-        save(client.paths.new_config_path, "core.package_id:default_unknown_mode=full_version_mode")
+        client.save_home({"global.conf": "core.package_id:default_unknown_mode=full_version_mode"})
         client.save({"conanfile.py": GenConanfile()})
         client.run("create . --name=liba --version=1.0")
         client.run("create . --name=liba --version=1.1")
@@ -37,7 +37,7 @@ class TestTransitiveIds:
         # So LibC package ID doesn't change, even if LibA changes
         # But LibD package ID changes, even if its direct dependency LibC doesn't
         client = TestClient(light=True)
-        save(client.paths.new_config_path, "core.package_id:default_unknown_mode=full_version_mode")
+        client.save_home({"global.conf": "core.package_id:default_unknown_mode=full_version_mode"})
         # LibA
         client.save({"conanfile.py": GenConanfile()})
         client.run("create . --name=liba --version=1.0")
@@ -132,7 +132,7 @@ class TestTransitiveIds:
     def test_transitive_header_only(self):
         # https://github.com/conan-io/conan/issues/6450
         client = TestClient(light=True)
-        save(client.paths.new_config_path, "core.package_id:default_unknown_mode=full_version_mode")
+        client.save_home({"global.conf": "core.package_id:default_unknown_mode=full_version_mode"})
         client.save({"conanfile.py": GenConanfile()})
         client.run("create . --name=liba --version=1.0")
         client.run("create . --name=liba --version=2.0")
diff --git a/test/integration/toolchains/env/test_virtualenv_winbash.py b/test/integration/toolchains/env/test_virtualenv_winbash.py
index 843c83aeb..1c1723260 100644
--- a/test/integration/toolchains/env/test_virtualenv_winbash.py
+++ b/test/integration/toolchains/env/test_virtualenv_winbash.py
@@ -5,7 +5,6 @@ import pytest
 
 from conan.test.assets.genconanfile import GenConanfile
 from conan.test.utils.tools import TestClient
-from conan.internal.util.files import save
 
 """
 When we use the VirtualRunEnv and VirtualBuildEnd generators, we take information from the
@@ -29,7 +28,7 @@ def client():
     """
     client.save({"conanfile.py": conanfile})
     client.run("create . --name=foo --version=1.0")
-    save(client.paths.new_config_path, "tools.microsoft.bash:subsystem=cygwin")
+    client.save_home({"global.conf": "tools.microsoft.bash:subsystem=cygwin"})
     return client
 
 
diff --git a/test/integration/toolchains/gnu/test_autotools.py b/test/integration/toolchains/gnu/test_autotools.py
new file mode 100644
index 000000000..05644b02b
--- /dev/null
+++ b/test/integration/toolchains/gnu/test_autotools.py
@@ -0,0 +1,28 @@
+import textwrap
+
+from conan.test.utils.tools import TestClient
+
+
+def test_autotools_make_parameters():
+    client = TestClient()
+    conanfile = textwrap.dedent("""
+        from conan import ConanFile
+        from conan.tools.gnu import AutotoolsToolchain, Autotools
+
+        class Conan(ConanFile):
+            settings = "os"
+            generators = "AutotoolsDeps", "AutotoolsToolchain", "VirtualRunEnv"
+
+            def run(self, cmd, *args, **kwargs):
+                self.output.info(f"Running {cmd}")
+
+            def build(self):
+                autotools = Autotools(self)
+                autotools.make(makefile="MyMake", target="test", args=["-j4", "VERBOSE=1"])
+                autotools.install(makefile="OtherMake")
+        """)
+
+    client.save({"conanfile.py": conanfile})
+    client.run("build .")
+    assert "make --file=MyMake test -j4 VERBOSE=1" in client.out
+    assert "make --file=OtherMake install" in client.out
diff --git a/test/integration/toolchains/gnu/test_makedeps.py b/test/integration/toolchains/gnu/test_makedeps.py
index 50d0b8f8b..253998aad 100644
--- a/test/integration/toolchains/gnu/test_makedeps.py
+++ b/test/integration/toolchains/gnu/test_makedeps.py
@@ -411,10 +411,12 @@ def test_makedeps_tool_requires():
     assert "CONAN_NAME_OTHER" not in make_content
 
 
-@pytest.mark.xfail(platform.system() == "Windows", reason="Test uses Unix-style paths not compatible with Windows filesystem.")
 @pytest.mark.parametrize("pattern, result, expected",
                          [("libs = []", False, 'SYSROOT'),
-                          ("sysroot = ['/foo/bar/sysroot']", True, 'CONAN_SYSROOT_PACKAGE = /foo/bar/sysroot')])
+                          ("sysroot = ['/foo/bar/sysroot']", True, 'CONAN_SYSROOT_PACKAGE = /foo/bar/sysroot')
+                          if platform.system() != "Windows" else
+                          ("sysroot = ['C:/my_sysroot']", True, 'CONAN_SYSROOT_PACKAGE = C:/my_sysroot')])
+
 def test_makefile_sysroot(pattern, result, expected):
     """
     The MakeDeps should not enforce sysroot in case not defined
diff --git a/test/integration/toolchains/premake/test_premake.py b/test/integration/toolchains/premake/test_premake.py
index b1ca86e29..ae6b2fea8 100644
--- a/test/integration/toolchains/premake/test_premake.py
+++ b/test/integration/toolchains/premake/test_premake.py
@@ -51,7 +51,7 @@ def test_premake_build_without_toolchain():
         "build . -s compiler=msvc -s compiler.version=193 -s compiler.runtime=dynamic",
         assert_error=True,
     )
-    assert "Premake.build() method requires PrmakeToolchain to work properly" in tc.out
+    assert "Premake.build() method requires PremakeToolchain to work properly" in tc.out
 
 
 def test_premake_build():
diff --git a/test/integration/ui/exit_with_code_test.py b/test/integration/ui/exit_with_code_test.py
index f2a470dd0..8914d9c85 100644
--- a/test/integration/ui/exit_with_code_test.py
+++ b/test/integration/ui/exit_with_code_test.py
@@ -1,7 +1,6 @@
 import textwrap
 
 from conan.test.utils.tools import TestClient
-from conan.internal.util.files import save
 
 
 def test_exit_with_code():
@@ -27,6 +26,6 @@ def test_exit_with_code():
 
 def test_wrong_home_error():
     client = TestClient(light=True)
-    save(client.paths.new_config_path, "core.cache:storage_path=//")
+    client.save_home({"global.conf": "core.cache:storage_path=//"})
     client.run("list *")
     assert "Couldn't initialize storage in" in client.out
diff --git a/test/unittests/client/remote_manager_test.py b/test/unittests/client/remote_manager_test.py
index edd06f6ae..cbad3cba0 100644
--- a/test/unittests/client/remote_manager_test.py
+++ b/test/unittests/client/remote_manager_test.py
@@ -1,5 +1,5 @@
 import os
-import unittest
+import pytest
 
 from conan.internal.api.uploader import compress_files
 from conan.internal.paths import PACKAGE_TGZ_NAME
@@ -7,7 +7,7 @@ from conan.test.utils.test_files import temp_folder
 from conan.internal.util.files import save
 
 
-class RemoteManagerTest(unittest.TestCase):
+class TestRemoteManager:
 
     def test_compress_files(self):
         folder = temp_folder()
@@ -20,6 +20,6 @@ class RemoteManagerTest(unittest.TestCase):
         }
 
         path = compress_files(files, PACKAGE_TGZ_NAME, dest_dir=folder)
-        self.assertTrue(os.path.exists(path))
+        assert os.path.exists(path)
         expected_path = os.path.join(folder, PACKAGE_TGZ_NAME)
-        self.assertEqual(path, expected_path)
+        assert path == expected_path
diff --git a/test/unittests/client/userio_test.py b/test/unittests/client/userio_test.py
index f75af150b..105ee3f77 100644
--- a/test/unittests/client/userio_test.py
+++ b/test/unittests/client/userio_test.py
@@ -1,24 +1,23 @@
-import unittest
-
-from mock import mock
+import pytest
+from unittest.mock import patch
 
 from conan.api.input import UserInput
 
 
-class UserInputTest(unittest.TestCase):
+class TestUserInput:
 
-    @mock.patch("conan.api.input.UserInput.get_username", return_value="username")
-    @mock.patch("conan.api.input.UserInput.get_password", return_value="passwd")
+    @patch("conan.api.input.UserInput.get_username", return_value="username")
+    @patch("conan.api.input.UserInput.get_password", return_value="passwd")
     def test_request_login(self, m1, m2):
         user_input = UserInput(non_interactive=False)
 
         # Use mocked ones
         u, p = user_input.request_login(remote_name="lol")
-        self.assertEqual(u, "username")
-        self.assertEqual(p, "passwd")
+        assert u == "username"
+        assert p == "passwd"
 
         # Use from argument
         username = "it's me!"
         u, p = user_input.request_login(remote_name="lol", username=username)
-        self.assertEqual(u, username)
-        self.assertEqual(p, "passwd")
+        assert u == username
+        assert p == "passwd"
diff --git a/test/unittests/model/conanfile_test.py b/test/unittests/model/conanfile_test.py
index 03c9cabc7..e325a7afb 100644
--- a/test/unittests/model/conanfile_test.py
+++ b/test/unittests/model/conanfile_test.py
@@ -1,21 +1,20 @@
 import textwrap
-import unittest
 
 from conan.internal.model.conan_file import ConanFile
 from conan.test.utils.tools import TestClient
 
 
-class ConanFileTest(unittest.TestCase):
+class TestConanFile:
     def test_conanfile_naming(self):
         for member in vars(ConanFile):
             if member.startswith('_') and not member.startswith("__"):
-                self.assertTrue(member.startswith('_conan'))
+                assert member.startswith('_conan')
 
         conanfile = ConanFile(None)
 
         for member in vars(conanfile):
             if member.startswith('_') and not member.startswith("__"):
-                self.assertTrue(member.startswith('_conan'))
+                assert member.startswith('_conan')
 
     def test_conanfile_naming_complete(self):
         client = TestClient()
diff --git a/test/unittests/model/versionrepr_test.py b/test/unittests/model/versionrepr_test.py
index d28ef3b16..082894a81 100644
--- a/test/unittests/model/versionrepr_test.py
+++ b/test/unittests/model/versionrepr_test.py
@@ -1,10 +1,10 @@
-import unittest
+import pytest
 
 from conan.internal.model.info import _VersionRepr
 from conan.internal.model.version import Version
 
 
-class VersionReprTest(unittest.TestCase):
+class TestVersionRepr:
 
     def test_text(self):
         v1 = Version("master+build2")
@@ -28,21 +28,21 @@ class VersionReprTest(unittest.TestCase):
 
         v1 = Version("1.2.3+build2")
         vr = _VersionRepr(v1)
-        self.assertEqual(vr.major(), "1.Y.Z")
-        self.assertEqual(vr.minor(), "1.2.Z")
-        self.assertEqual(vr.patch(), "1.2.3")
-        self.assertEqual(vr.pre(), "1.2.3")
-        self.assertEqual(vr.build, "build2")
-        self.assertEqual(vr.stable(), "1.Y.Z")
+        assert vr.major() == "1.Y.Z"
+        assert vr.minor() == "1.2.Z"
+        assert vr.patch() == "1.2.3"
+        assert vr.pre() == "1.2.3"
+        assert vr.build == "build2"
+        assert vr.stable() == "1.Y.Z"
 
         v1 = Version("0.2.3-alpha1+build2")
         vr = _VersionRepr(v1)
-        self.assertEqual(vr.major(), "0.Y.Z")
-        self.assertEqual(vr.minor(), "0.2.Z")
-        self.assertEqual(vr.patch(), "0.2.3")
-        self.assertEqual(vr.pre(), "0.2.3-alpha1")
-        self.assertEqual(vr.build, "build2")
-        self.assertEqual(vr.stable(), "0.2.3-alpha1+build2")
+        assert vr.major() == "0.Y.Z"
+        assert vr.minor() == "0.2.Z"
+        assert vr.patch() == "0.2.3"
+        assert vr.pre() == "0.2.3-alpha1"
+        assert vr.build == "build2"
+        assert vr.stable() == "0.2.3-alpha1+build2"
 
         v1 = Version("+build2")
         vr = _VersionRepr(v1)
@@ -51,7 +51,7 @@ class VersionReprTest(unittest.TestCase):
     def test_build(self):
         v1 = Version("0.2.3-alpha1+build2")
         vr = _VersionRepr(v1)
-        self.assertEqual(vr.build, "build2")
+        assert vr.build == "build2"
         v2 = Version("0.2.3+b178")
         vr = _VersionRepr(v2)
-        self.assertEqual(vr.build, "b178")
+        assert vr.build == "b178"
diff --git a/test/unittests/util/conanfile_tools_test.py b/test/unittests/util/conanfile_tools_test.py
index 345991bcc..1056f2137 100644
--- a/test/unittests/util/conanfile_tools_test.py
+++ b/test/unittests/util/conanfile_tools_test.py
@@ -1,6 +1,5 @@
 import os
 import stat
-import unittest
 
 from conan.tools.files import replace_in_file, unzip
 from conan.test.utils.mocks import ConanFileMock
@@ -10,7 +9,7 @@ from conan.test.utils.tools import TestClient
 from conan.internal.util.files import load, save
 
 
-class ConanfileToolsTest(unittest.TestCase):
+class TestConanfileTools:
 
     def test_save_append(self):
         # https://github.com/conan-io/conan/issues/2841 (regression)
@@ -24,7 +23,7 @@ class Pkg(ConanFile):
         client.save({"conanfile.py": conanfile,
                      "myfile.txt": "World"})
         client.run("source .")
-        self.assertEqual("WorldHello", client.load("myfile.txt"))
+        assert "WorldHello" == client.load("myfile.txt")
 
     def test_untar(self):
         tmp_dir = temp_folder()
@@ -43,14 +42,14 @@ class Pkg(ConanFile):
         output_dir = os.path.join(tmp_dir, "output_dir")
         unzip(ConanFileMock(), tar_path, output_dir)
         content = load(os.path.join(output_dir, "example.txt"))
-        self.assertEqual(content, "Hello world!")
+        assert content == "Hello world!"
 
     def test_replace_in_file(self):
         tmp_dir = temp_folder()
         text_file = os.path.join(tmp_dir, "text.txt")
         save(text_file, "ONE TWO THREE")
         replace_in_file(ConanFileMock(), text_file, "ONE TWO THREE", "FOUR FIVE SIX")
-        self.assertEqual(load(text_file), "FOUR FIVE SIX")
+        assert load(text_file) == "FOUR FIVE SIX"
 
     def test_replace_in_file_readonly(self):
         """
@@ -63,5 +62,8 @@ class Pkg(ConanFile):
         os.chmod(text_file,
                  os.stat(text_file).st_mode & ~(stat.S_IWRITE | stat.S_IWGRP | stat.S_IWOTH))
 
-        with self.assertRaises(PermissionError):
+        try:
             replace_in_file(ConanFileMock(), text_file, "ONE TWO THREE", "FOUR FIVE SIX")
+            assert False, "Expected PermissionError"
+        except PermissionError:
+            pass
diff --git a/test/unittests/util/detect_test.py b/test/unittests/util/detect_test.py
index 84f7cf3e2..476b89b16 100644
--- a/test/unittests/util/detect_test.py
+++ b/test/unittests/util/detect_test.py
@@ -1,9 +1,6 @@
-import unittest
-
 import mock
 from unittest.mock import patch
 import pytest
-from parameterized import parameterized
 
 from conan.internal.api.detect.detect_api import _cc_compiler, detect_suncc_compiler, \
     detect_intel_compiler
@@ -14,14 +11,14 @@ from conan.test.utils.tools import redirect_output
 from conan.test.utils.env import environment_update
 
 
-class DetectTest(unittest.TestCase):
+class TestDetect:
     @mock.patch("platform.machine", return_value="")
     def test_detect_empty_arch(self, _):
         result = detect_defaults_settings()
         result = dict(result)
-        self.assertTrue("arch" not in result)
+        assert "arch" not in result
 
-    @parameterized.expand([
+    @pytest.mark.parametrize("processor,bitness,version,expected_arch", [
         ['powerpc', '64', '7.1.0.0', 'ppc64'],
         ['powerpc', '32', '7.1.0.0', 'ppc32'],
         ['rs6000', None, '4.2.1.0', 'ppc32']
@@ -34,10 +31,10 @@ class DetectTest(unittest.TestCase):
                 mock.patch('subprocess.check_output', mock.MagicMock(return_value=version)):
             result = detect_defaults_settings()
             result = dict(result)
-            self.assertEqual("AIX", result['os'])
-            self.assertEqual(expected_arch, result['arch'])
+            assert "AIX" == result['os']
+            assert expected_arch == result['arch']
 
-    @parameterized.expand([
+    @pytest.mark.parametrize("machine,expected_arch", [
         ['arm64', 'armv8'],
         ['i386', 'x86'],
         ['i686', 'x86'],
@@ -50,7 +47,7 @@ class DetectTest(unittest.TestCase):
         with mock.patch("platform.machine", mock.MagicMock(return_value=machine)):
             result = detect_defaults_settings()
             result = dict(result)
-            self.assertEqual(expected_arch, result['arch'])
+            assert expected_arch == result['arch']
 
     @mock.patch("conan.internal.api.detect.detect_api.detect_clang_compiler",
                 return_value=("clang", Version("9"), "clang"))
@@ -59,7 +56,7 @@ class DetectTest(unittest.TestCase):
         with redirect_output(output):
             with environment_update({"CC": "clang-9 --gcc-toolchain=/usr/lib/gcc/x86_64-linux-gnu/9"}):
                 detect_defaults_settings()
-                self.assertIn("CC and CXX: clang-9 --gcc-toolchain", output)
+                assert "CC and CXX: clang-9 --gcc-toolchain" in output
 
 
 @pytest.mark.parametrize("version_return,expected_version", [
diff --git a/test/unittests/util/detected_architecture_test.py b/test/unittests/util/detected_architecture_test.py
index 5db15b928..f05693014 100644
--- a/test/unittests/util/detected_architecture_test.py
+++ b/test/unittests/util/detected_architecture_test.py
@@ -1,14 +1,12 @@
 import mock
-import unittest
-
-from parameterized import parameterized
+import pytest
 
 from conan.internal.api.detect.detect_api import detect_arch
 
 
-class DetectedArchitectureTest(unittest.TestCase):
+class TestDetectedArchitecture:
 
-    @parameterized.expand([
+    @pytest.mark.parametrize("mocked_machine,expected_arch", [
         ['i386', 'x86'],
         ['i686', 'x86'],
         ['x86_64', 'x86_64'],
@@ -33,9 +31,8 @@ class DetectedArchitectureTest(unittest.TestCase):
         ['riscv32', "riscv32"]
     ])
     def test_various(self, mocked_machine, expected_arch):
-
         with mock.patch("platform.machine", mock.MagicMock(return_value=mocked_machine)):
-            self.assertEqual(expected_arch, detect_arch(), "given '%s' expected '%s'" % (mocked_machine, expected_arch))
+            assert expected_arch == detect_arch(), f"given '{mocked_machine}' expected '{expected_arch}'"
 
     def test_aix(self):
         with mock.patch("platform.machine", mock.MagicMock(return_value='00FB91F44C00')),\
@@ -43,14 +40,14 @@ class DetectedArchitectureTest(unittest.TestCase):
                 mock.patch("platform.system", mock.MagicMock(return_value='AIX')),\
                 mock.patch("conan.internal.api.detect.detect_api._get_aix_conf", mock.MagicMock(return_value='32')),\
                 mock.patch('subprocess.check_output', mock.MagicMock(return_value='7.1.0.0')):
-            self.assertEqual('ppc32', detect_arch())
+            assert 'ppc32' == detect_arch()
 
         with mock.patch("platform.machine", mock.MagicMock(return_value='00FB91F44C00')),\
                 mock.patch("platform.processor", mock.MagicMock(return_value='powerpc')),\
                 mock.patch("platform.system", mock.MagicMock(return_value='AIX')),\
                 mock.patch("conan.internal.api.detect.detect_api._get_aix_conf", mock.MagicMock(return_value='64')),\
                 mock.patch('subprocess.check_output', mock.MagicMock(return_value='7.1.0.0')):
-            self.assertEqual('ppc64', detect_arch())
+            assert 'ppc64' == detect_arch()
 
     def test_solaris(self):
         with mock.patch("platform.machine", mock.MagicMock(return_value='sun4v')),\
@@ -58,16 +55,16 @@ class DetectedArchitectureTest(unittest.TestCase):
                 mock.patch("platform.system", mock.MagicMock(return_value='SunOS')),\
                 mock.patch("platform.architecture", mock.MagicMock(return_value=('64bit', 'ELF'))),\
                 mock.patch("platform.release", mock.MagicMock(return_value='5.11')):
-            self.assertEqual('sparcv9', detect_arch())
+            assert 'sparcv9' == detect_arch()
 
         with mock.patch("platform.machine", mock.MagicMock(return_value='i86pc')),\
                 mock.patch("platform.processor", mock.MagicMock(return_value='i386')),\
                 mock.patch("platform.system", mock.MagicMock(return_value='SunOS')),\
                 mock.patch("platform.architecture", mock.MagicMock(return_value=('64bit', 'ELF'))),\
                 mock.patch("platform.release", mock.MagicMock(return_value='5.11')):
-            self.assertEqual('x86_64', detect_arch())
+            assert 'x86_64' == detect_arch()
 
-    @parameterized.expand([
+    @pytest.mark.parametrize("processor,expected_arch", [
         ["E1C+", "e2k-v4"],
         ["E2C+", "e2k-v2"],
         ["E2C+DSP", "e2k-v2"],
@@ -82,4 +79,4 @@ class DetectedArchitectureTest(unittest.TestCase):
     def test_e2k(self, processor, expected_arch):
         with mock.patch("platform.machine", mock.MagicMock(return_value='e2k')), \
                 mock.patch("platform.processor", mock.MagicMock(return_value=processor)):
-            self.assertEqual(expected_arch, detect_arch())
+            assert expected_arch == detect_arch()
diff --git a/test/unittests/util/file_hashes_test.py b/test/unittests/util/file_hashes_test.py
index 730fce368..d66caba84 100644
--- a/test/unittests/util/file_hashes_test.py
+++ b/test/unittests/util/file_hashes_test.py
@@ -1,5 +1,5 @@
 import os
-import unittest
+import pytest
 
 from conan.tools.files import check_md5, check_sha1, check_sha256
 from conan.errors import ConanException
@@ -8,7 +8,7 @@ from conan.test.utils.test_files import temp_folder
 from conan.internal.util.files import save
 
 
-class HashesTest(unittest.TestCase):
+class TestHashes:
 
     def test_md5(self):
         folder = temp_folder()
@@ -20,11 +20,11 @@ class HashesTest(unittest.TestCase):
         check_sha1(ConanFileMock(), filepath, "eb599ec83d383f0f25691c184f656d40384f9435")
         check_sha256(ConanFileMock(), filepath, "7365d029861e32c521f8089b00a6fb32daf0615025b69b599d1ce53501b845c2")
 
-        with self.assertRaisesRegex(ConanException, "md5 signature failed for 'file.txt' file."):
+        with pytest.raises(ConanException, match="md5 signature failed for 'file.txt' file."):
             check_md5(ConanFileMock(), filepath, "invalid")
 
-        with self.assertRaisesRegex(ConanException, "sha1 signature failed for 'file.txt' file."):
+        with pytest.raises(ConanException, match="sha1 signature failed for 'file.txt' file."):
             check_sha1(ConanFileMock(), filepath, "invalid")
 
-        with self.assertRaisesRegex(ConanException, "sha256 signature failed for 'file.txt' file."):
+        with pytest.raises(ConanException, match="sha256 signature failed for 'file.txt' file."):
             check_sha256(ConanFileMock(), filepath, "invalid")
diff --git a/test/unittests/util/files/strip_root_extract_test.py b/test/unittests/util/files/strip_root_extract_test.py
index 1e219be78..94f24f476 100644
--- a/test/unittests/util/files/strip_root_extract_test.py
+++ b/test/unittests/util/files/strip_root_extract_test.py
@@ -1,6 +1,5 @@
 import os
 import tarfile
-import unittest
 import zipfile
 
 from conan.internal.api.uploader import gzopen_without_timestamps
@@ -15,7 +14,7 @@ from conan.internal.util.files import chdir, save
 from conan.internal.util.files import rmdir
 
 
-class ZipExtractPlainTest(unittest.TestCase):
+class TestZipExtractPlain:
 
     def _zipdir(self, path, zipfilename, folder_entry=None):
         with zipfile.ZipFile(zipfilename, 'w', zipfile.ZIP_DEFLATED) as z:
@@ -52,23 +51,23 @@ class ZipExtractPlainTest(unittest.TestCase):
         output = RedirectedTestOutput()
         with redirect_output(output):
             unzip(ConanFileMock(), zip_file, destination=extract_folder, strip_root=False)
-        self.assertNotIn("ERROR: Error extract", output)
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "file1")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "folder",
-                                                    "file2")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "file3")))
+        assert "ERROR: Error extract" not in output
+        assert os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3"))
+        assert os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "file1"))
+        assert os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "folder",
+                                           "file2"))
+        assert os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "file3"))
 
         # Extract without the subfolder
         extract_folder = temp_folder()
         output = RedirectedTestOutput()
         with redirect_output(output):
             unzip(ConanFileMock(), zip_file, destination=extract_folder, strip_root=True)
-        self.assertNotIn("ERROR: Error extract", output)
-        self.assertFalse(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "file1")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "folder", "file2")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "file3")))
+        assert "ERROR: Error extract" not in output
+        assert not os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3"))
+        assert os.path.exists(os.path.join(extract_folder, "file1"))
+        assert os.path.exists(os.path.join(extract_folder, "folder", "file2"))
+        assert os.path.exists(os.path.join(extract_folder, "file3"))
 
     def test_invalid_flat(self):
         tmp_folder = temp_folder()
@@ -86,9 +85,11 @@ class ZipExtractPlainTest(unittest.TestCase):
 
         # Extract without the subfolder
         extract_folder = temp_folder()
-        with self.assertRaisesRegex(ConanException, "The zip file contains more than 1 folder "
-                                                         "in the root"):
+        try:
             unzip(ConanFileMock(), zip_file, destination=extract_folder, strip_root=True)
+            assert False, "Expected ConanException"
+        except ConanException as e:
+            assert "The zip file contains more than 1 folder in the root" in str(e)
 
     def test_invalid_flat_single_file(self):
         tmp_folder = temp_folder()
@@ -101,11 +102,14 @@ class ZipExtractPlainTest(unittest.TestCase):
 
         # Extract without the subfolder
         extract_folder = temp_folder()
-        with self.assertRaisesRegex(ConanException, "The zip file contains a file in the root"):
+        try:
             unzip(ConanFileMock(), zip_file, destination=extract_folder, strip_root=True)
+            assert False, "Expected ConanException"
+        except ConanException as e:
+            assert "The zip file contains a file in the root" in str(e)
 
 
-class TarExtractPlainTest(unittest.TestCase):
+class TestTarExtractPlain:
 
     def _compress_folder(self, folder, tgz_path, folder_entry=None):
         # Create a tar.gz file with the files in the folder and an additional TarInfo entry
@@ -186,19 +190,19 @@ class TarExtractPlainTest(unittest.TestCase):
         # Tgz unzipped regularly
         extract_folder = temp_folder()
         untargz(tgz_file, destination=extract_folder, strip_root=False)
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "file1")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "folder",
-                                                    "file2")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "file3")))
+        assert os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3"))
+        assert os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "file1"))
+        assert os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "folder",
+                                           "file2"))
+        assert os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3", "file3"))
 
         # Extract without the subfolder
         extract_folder = temp_folder()
         untargz(tgz_file, destination=extract_folder, strip_root=True)
-        self.assertFalse(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "file1")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "folder", "file2")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "file3")))
+        assert not os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3"))
+        assert os.path.exists(os.path.join(extract_folder, "file1"))
+        assert os.path.exists(os.path.join(extract_folder, "folder", "file2"))
+        assert os.path.exists(os.path.join(extract_folder, "file3"))
 
     def test_plain_tgz_common_base(self):
 
@@ -221,10 +225,10 @@ class TarExtractPlainTest(unittest.TestCase):
         # Tgz unzipped regularly
         extract_folder = temp_folder()
         untargz(tgz_file, destination=extract_folder, strip_root=True)
-        self.assertFalse(os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "folder", "file1")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "folder", "file2")))
-        self.assertTrue(os.path.exists(os.path.join(extract_folder, "folder", "file3")))
+        assert not os.path.exists(os.path.join(extract_folder, "subfolder-1.2.3"))
+        assert os.path.exists(os.path.join(extract_folder, "folder", "file1"))
+        assert os.path.exists(os.path.join(extract_folder, "folder", "file2"))
+        assert os.path.exists(os.path.join(extract_folder, "folder", "file3"))
 
     def test_invalid_flat(self):
         tmp_folder = temp_folder()
@@ -241,9 +245,11 @@ class TarExtractPlainTest(unittest.TestCase):
         self._compress_folder(tmp_folder, tgz_file)
 
         extract_folder = temp_folder()
-        with self.assertRaisesRegex(ConanException, "The tgz file contains more than 1 folder "
-                                                         "in the root"):
+        try:
             untargz(tgz_file, destination=extract_folder, strip_root=True)
+            assert False, "Expected ConanException"
+        except ConanException as e:
+            assert "The tgz file contains more than 1 folder in the root" in str(e)
 
     def test_invalid_flat_single_file(self):
         tmp_folder = temp_folder()
@@ -256,8 +262,11 @@ class TarExtractPlainTest(unittest.TestCase):
 
         # Extract without the subfolder
         extract_folder = temp_folder()
-        with self.assertRaisesRegex(ConanException, "Can't untar a tgz containing files in the root with strip_root enabled"):
+        try:
             unzip(ConanFileMock(), tgz_file, destination=extract_folder, strip_root=True)
+            assert False, "Expected ConanException"
+        except ConanException as e:
+            assert "Can't untar a tgz containing files in the root with strip_root enabled" in str(e)
 
     def test_invalid_flat_multiple_file(self):
         tmp_folder = temp_folder()
@@ -271,8 +280,11 @@ class TarExtractPlainTest(unittest.TestCase):
 
         # Extract without the subfolder
         extract_folder = temp_folder()
-        with self.assertRaisesRegex(ConanException, "Can't untar a tgz containing files in the root with strip_root enabled"):
+        try:
             unzip(ConanFileMock(), tgz_file, destination=extract_folder, strip_root=True)
+            assert False, "Expected ConanException"
+        except ConanException as e:
+            assert "Can't untar a tgz containing files in the root with strip_root enabled" in str(e)
 
 
 def _compress_root_folder(folder, tgz_path, root_folder_name="root"):
diff --git a/test/unittests/util/local_db_test.py b/test/unittests/util/local_db_test.py
index 4f35601f1..28323559b 100644
--- a/test/unittests/util/local_db_test.py
+++ b/test/unittests/util/local_db_test.py
@@ -1,26 +1,23 @@
 import os
-import unittest
 
 from conan.internal.api.remotes.localdb import LocalDB
 from conan.test.utils.test_files import temp_folder
 
 
-class LocalStoreTest(unittest.TestCase):
+def test_localdb():
+    tmp_dir = temp_folder()
+    db_file = os.path.join(tmp_dir, "dbfile")
+    localdb = LocalDB(db_file)
 
-    def test_localdb(self):
-        tmp_dir = temp_folder()
-        db_file = os.path.join(tmp_dir, "dbfile")
-        localdb = LocalDB(db_file)
+    # Test write and read login
+    user, token, access_token = localdb.get_login("myurl1")
+    assert user is None
+    assert token is None
+    assert access_token is None
 
-        # Test write and read login
-        user, token, access_token = localdb.get_login("myurl1")
-        self.assertIsNone(user)
-        self.assertIsNone(token)
-        self.assertIsNone(access_token)
-
-        localdb.store("pepe", "token", "access_token", "myurl1")
-        user, token, access_token = localdb.get_login("myurl1")
-        self.assertEqual("pepe", user)
-        self.assertEqual("token", token)
-        self.assertEqual("access_token", access_token)
-        self.assertEqual("pepe", localdb.get_username("myurl1"))
+    localdb.store("pepe", "token", "access_token", "myurl1")
+    user, token, access_token = localdb.get_login("myurl1")
+    assert user == "pepe"
+    assert token == "token"
+    assert access_token == "access_token"
+    assert "pepe" == localdb.get_username("myurl1")
diff --git a/test/unittests/util/output_test.py b/test/unittests/util/output_test.py
index a455408f4..c32bea122 100644
--- a/test/unittests/util/output_test.py
+++ b/test/unittests/util/output_test.py
@@ -1,10 +1,7 @@
 import os
-import platform
-import unittest
+import textwrap
 import zipfile
 
-import pytest
-
 from conan.tools.files import unzip
 from conan.test.utils.mocks import RedirectedTestOutput, ConanFileMock
 from conan.test.utils.test_files import temp_folder
@@ -12,25 +9,22 @@ from conan.test.utils.tools import TestClient, redirect_output
 from conan.internal.util.files import load, save
 
 
-class OutputTest(unittest.TestCase):
+class TestOutput:
 
     def test_error(self):
         client = TestClient()
-        conanfile = """
-# -*- coding: utf-8 -*-
-
-from conan import ConanFile
-from conan.errors import ConanException
+        conanfile = textwrap.dedent("""
+            from conan import ConanFile
 
-class PkgConan(ConanFile):
-    def source(self):
-       self.output.info("TEXT ÑÜíóúéáàèòù абвгдежзийкл 做戏之说  ENDTEXT")
-"""
+            class PkgConan(ConanFile):
+                def source(self):
+                   self.output.info("TEXT ÑÜíóúéáàèòù абвгдежзийкл 做戏之说  ENDTEXT")
+            """)
         client.save({"conanfile.py": conanfile})
         client.run("install .")
         client.run("source .")
-        self.assertIn("TEXT", client.out)
-        self.assertIn("ENDTEXT", client.out)
+        assert "TEXT" in client.out
+        assert "ENDTEXT" in client.out
 
     def test_unzip_output(self):
         tmp_dir = temp_folder()
@@ -50,28 +44,6 @@ class PkgConan(ConanFile):
             unzip(ConanFileMock(), zip_path, output_dir)
 
         output = captured_output.getvalue()
-        self.assertRegex(output, r"Unzipping [\d]+B")
+        assert "Unzipping" in output
         content = load(os.path.join(output_dir, "example.txt"))
-        self.assertEqual(content, "Hello world!")
-
-    @pytest.mark.skipif(platform.system() != "Windows", reason="Requires windows")
-    @pytest.mark.xfail(reason="We have to investigate why this test is failing")
-    def test_short_paths_unzip_output(self):
-        tmp_dir = temp_folder()
-        file_path = os.path.join(tmp_dir, "src/"*40, "example.txt")
-        save(file_path, "Hello world!")
-
-        zip_path = os.path.join(tmp_dir, 'example.zip')
-        zipf = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED)
-        for root, _, files in os.walk(tmp_dir):
-            for f in files:
-                zipf.write(os.path.join(root, f), os.path.join("src/"*20, f))
-        zipf.close()
-
-        output_dir = os.path.join(tmp_dir, "dst/"*40, "output_dir")
-        captured_output = RedirectedTestOutput()
-        with redirect_output(captured_output):
-            unzip(ConanFileMock(), zip_path, output_dir)
-
-        output = captured_output.getvalue()
-        self.assertIn("ERROR: Error extract src/src", output)
+        assert content == "Hello world!"
diff --git a/test/unittests/util/tools_test.py b/test/unittests/util/tools_test.py
index fa943d155..e59a8fe90 100644
--- a/test/unittests/util/tools_test.py
+++ b/test/unittests/util/tools_test.py
@@ -1,7 +1,6 @@
 import os
 import platform
 import subprocess
-import unittest
 
 import pytest
 
@@ -27,68 +26,65 @@ class RunnerMock:
         return 0 if self.return_ok else 1
 
 
-class ReplaceInFileTest(unittest.TestCase):
-    def setUp(self):
-        text = u'J\xe2nis\xa7'
-        self.tmp_folder = temp_folder()
+def test_replace_in_file():
+    text = u'J\xe2nis\xa7'
+    tmp_folder = temp_folder()
 
-        self.win_file = os.path.join(self.tmp_folder, "win_encoding.txt")
-        text = text.encode("Windows-1252", "ignore")
-        with open(self.win_file, "wb") as handler:
-            handler.write(text)
+    win_file = os.path.join(tmp_folder, "win_encoding.txt")
+    text = text.encode("Windows-1252", "ignore")
+    with open(win_file, "wb") as handler:
+        handler.write(text)
+    replace_in_file(ConanFileMock(), win_file, "nis", "nus", encoding="Windows-1252")
 
-    def test_replace_in_file(self):
-        replace_in_file(ConanFileMock(), self.win_file, "nis", "nus", encoding="Windows-1252")
+    content = load(win_file, encoding="Windows-1252")
+    assert "nis" not in  content
+    assert "nus" in content
 
-        content = load(self.win_file, encoding="Windows-1252")
-        self.assertNotIn("nis", content)
-        self.assertIn("nus", content)
 
-
-class ToolsTest(unittest.TestCase):
+class TestToolsTest:
 
     def test_load_save(self):
         folder = temp_folder()
         path = os.path.join(folder, "file")
         save(path, u"äüïöñç")
         content = load(path)
-        self.assertEqual(content, u"äüïöñç")
+        assert content == u"äüïöñç"
 
     def test_md5(self):
         result = md5(u"äüïöñç")
-        self.assertEqual("dfcc3d74aa447280a7ecfdb98da55174", result)
+        assert "dfcc3d74aa447280a7ecfdb98da55174" == result
 
     def test_environment_nested(self):
         with environment_update({"A": "1", "Z": "40"}):
             with environment_update({"A": "1", "B": "2"}):
                 with environment_update({"A": "2", "B": "2"}):
-                    self.assertEqual(os.getenv("A"), "2")
-                    self.assertEqual(os.getenv("B"), "2")
-                    self.assertEqual(os.getenv("Z"), "40")
-                self.assertEqual(os.getenv("A", None), "1")
-                self.assertEqual(os.getenv("B", None), "2")
-            self.assertEqual(os.getenv("A", None), "1")
-            self.assertEqual(os.getenv("Z", None), "40")
-
-        self.assertEqual(os.getenv("A", None), None)
-        self.assertEqual(os.getenv("B", None), None)
-        self.assertEqual(os.getenv("Z", None), None)
+                    assert os.getenv("A") == "2"
+                    assert os.getenv("B") == "2"
+                    assert os.getenv("Z") == "40"
+                assert os.getenv("A") == "1"
+                assert os.getenv("B",) == "2"
+            assert os.getenv("A",) == "1"
+            assert os.getenv("Z") == "40"
+
+        assert os.getenv("A") is None
+        assert os.getenv("B") is None
+        assert os.getenv("Z") is None
 
     def test_check_output_runner(self):
         payload = "hello world"
         output = check_output_runner("echo {}".format(payload), stderr=subprocess.STDOUT)
-        self.assertIn(payload, str(output))
+        assert payload in str(output)
 
 
-class CollectLibTestCase(unittest.TestCase):
+class TestCollectLib:
 
     def test_collect_libs(self):
         output = RedirectedTestOutput()
-        with redirect_output(output):
+        with (redirect_output(output)):
             conanfile = ConanFileMock()
             # Without package_folder
             result = collect_libs(conanfile)
-            self.assertEqual([], result)
+            assert []  == result
 
             # Default behavior
             conanfile.folders.set_base_package(temp_folder())
@@ -96,29 +92,29 @@ class CollectLibTestCase(unittest.TestCase):
             save(mylib_path, "")
             conanfile.cpp = Infos()
             result = collect_libs(conanfile)
-            self.assertEqual(["mylib"], result)
+            assert ["mylib"]  == result
 
             # Custom folder
             customlib_path = os.path.join(conanfile.package_folder, "custom_folder", "customlib.lib")
             save(customlib_path, "")
             result = collect_libs(conanfile, folder="custom_folder")
-            self.assertEqual(["customlib"], result)
+            assert ["customlib"]  == result
 
             # Custom folder doesn't exist
             result = collect_libs(conanfile, folder="fake_folder")
-            self.assertEqual([], result)
-            self.assertIn("Lib folder doesn't exist, can't collect libraries:", output.getvalue())
+            assert []  == result
+            assert "Lib folder doesn't exist, can't collect libraries:" in output.getvalue()
             output.clear()
 
             # Use cpp_info.libdirs
             conanfile.cpp_info.libdirs = ["lib", "custom_folder"]
             result = collect_libs(conanfile)
-            self.assertEqual(["customlib", "mylib"], result)
+            assert ["customlib", "mylib"]  == result
 
             # Custom folder with multiple libdirs should only collect from custom folder
-            self.assertEqual(["lib", "custom_folder"], conanfile.cpp_info.libdirs)
+            assert ["lib", "custom_folder"] == conanfile.cpp_info.libdirs
             result = collect_libs(conanfile, folder="custom_folder")
-            self.assertEqual(["customlib"], result)
+            assert ["customlib"]  == result
 
             # Warn same lib different folders
             conanfile = ConanFileMock()
@@ -132,7 +128,7 @@ class CollectLibTestCase(unittest.TestCase):
 
             output.clear()
             result = collect_libs(conanfile)
-            self.assertEqual(["mylib"], result)
+            assert ["mylib"]  == result
 
             # Warn lib folder does not exist with correct result
             conanfile = ConanFileMock()
@@ -144,9 +140,9 @@ class CollectLibTestCase(unittest.TestCase):
             conanfile.cpp_info.libdirs = ["no_folder", "lib"]  # 'no_folder' does NOT exist
             output.clear()
             result = collect_libs(conanfile)
-            self.assertEqual(["mylib"], result)
-            self.assertIn("WARN: Lib folder doesn't exist, can't collect libraries: %s"
-                          % no_folder_path, output.getvalue())
+            assert ["mylib"]  == result
+            assert ("WARN: Lib folder doesn't exist, "
+                    "can't collect libraries: %s") % no_folder_path in output.getvalue()
 
     @pytest.mark.skipif(platform.system() == "Windows", reason="Needs symlinks support")
     def test_collect_libs_symlinks(self):
@@ -166,7 +162,7 @@ class CollectLibTestCase(unittest.TestCase):
         save(lib_mylib3_path, "")
         conanfile.cpp_info.libdirs = ["lib", "custom_folder"]
         result = collect_libs(conanfile)
-        self.assertEqual(["mylib", "mylib.2", "mylib.3"], result)
+        assert ["mylib", "mylib.2", "mylib.3"]  == result
 
     def test_self_collect_libs(self):
         output = RedirectedTestOutput()
@@ -174,7 +170,7 @@ class CollectLibTestCase(unittest.TestCase):
             conanfile = ConanFileMock()
             # Without package_folder
             result = collect_libs(conanfile)
-            self.assertEqual([], result)
+            assert []  == result
 
             # Default behavior
             conanfile.folders.set_base_package(temp_folder())
@@ -182,29 +178,29 @@ class CollectLibTestCase(unittest.TestCase):
             save(mylib_path, "")
             conanfile.cpp = Infos()
             result = collect_libs(conanfile)
-            self.assertEqual(["mylib"], result)
+            assert ["mylib"]  == result
 
             # Custom folder
             customlib_path = os.path.join(conanfile.package_folder, "custom_folder", "customlib.lib")
             save(customlib_path, "")
             result = collect_libs(conanfile, folder="custom_folder")
-            self.assertEqual(["customlib"], result)
+            assert ["customlib"]  == result
 
             # Custom folder doesn't exist
             output.clear()
             result = collect_libs(conanfile, folder="fake_folder")
-            self.assertEqual([], result)
-            self.assertIn("Lib folder doesn't exist, can't collect libraries:", output.getvalue())
+            assert []  == result
+            assert "Lib folder doesn't exist, can't collect libraries:" in output.getvalue()
 
             # Use cpp_info.libdirs
             conanfile.cpp_info.libdirs = ["lib", "custom_folder"]
             result = collect_libs(conanfile)
-            self.assertEqual(["customlib", "mylib"], result)
+            assert ["customlib", "mylib"]  == result
 
             # Custom folder with multiple libdirs should only collect from custom folder
-            self.assertEqual(["lib", "custom_folder"], conanfile.cpp_info.libdirs)
+            assert ["lib", "custom_folder"] == conanfile.cpp_info.libdirs
             result = collect_libs(conanfile, folder="custom_folder")
-            self.assertEqual(["customlib"], result)
+            assert ["customlib"]  == result
 
             # Warn same lib different folders
             conanfile = ConanFileMock()
@@ -217,7 +213,7 @@ class CollectLibTestCase(unittest.TestCase):
             conanfile.cpp_info.libdirs = ["lib", "custom_folder"]
             output.clear()
             result = collect_libs(conanfile)
-            self.assertEqual(["mylib"], result)
+            assert ["mylib"]  == result
 
             # Warn lib folder does not exist with correct result
             conanfile = ConanFileMock()
@@ -229,9 +225,9 @@ class CollectLibTestCase(unittest.TestCase):
             conanfile.cpp_info.libdirs = ["no_folder", "lib"]  # 'no_folder' does NOT exist
             output.clear()
             result = collect_libs(conanfile)
-            self.assertEqual(["mylib"], result)
-            self.assertIn("WARN: Lib folder doesn't exist, can't collect libraries: %s"
-                          % no_folder_path, output.getvalue())
+            assert ["mylib"]  == result
+            assert ("WARN: Lib folder doesn't exist, "
+                    "can't collect libraries: %s" % no_folder_path in output.getvalue())
 
     @pytest.mark.skipif(platform.system() == "Windows", reason="Needs symlinks support")
     def test_self_collect_libs_symlinks(self):
@@ -251,4 +247,4 @@ class CollectLibTestCase(unittest.TestCase):
         save(lib_mylib3_path, "")
         conanfile.cpp_info.libdirs = ["lib", "custom_folder"]
         result = collect_libs(conanfile)
-        self.assertEqual(["mylib", "mylib.2", "mylib.3"], result)
+        assert ["mylib", "mylib.2", "mylib.3"]  == result
diff --git a/test/unittests/util/unix_path_test.py b/test/unittests/util/unix_path_test.py
index 7b9a9c030..7fc337df6 100644
--- a/test/unittests/util/unix_path_test.py
+++ b/test/unittests/util/unix_path_test.py
@@ -1,7 +1,5 @@
 import os
 import platform
-import unittest
-
 import pytest
 
 from conan.tools.microsoft.subsystems import subsystem_path
@@ -10,21 +8,21 @@ from conan.test.utils.test_files import temp_folder
 from conan.internal.util.files import mkdir
 
 
-class GetCasedPath(unittest.TestCase):
+class TestGetCasedPath:
     @pytest.mark.skipif(platform.system() != "Windows", reason="Requires Windows")
     def test_case_existing(self):
         folder = get_cased_path(temp_folder())
         p1 = os.path.join(folder, "MyFolder", "Subfolder")
         mkdir(p1)
 
-        self.assertEqual(p1, get_cased_path(p1))  # Idempotent
-        self.assertEqual(p1, get_cased_path(os.path.join(folder, "myfolder", "subfolder")))
+        assert p1 == get_cased_path(p1)  # Idempotent
+        assert p1 == get_cased_path(os.path.join(folder, "myfolder", "subfolder"))
 
     def test_case_not_existing(self):
         current_dir = get_cased_path(os.getcwd())
         non_existing_path = os.path.join(current_dir, "this", "Path", "does", "NOT", "Exists")
         p = get_cased_path(non_existing_path)  # If not exists from the root, returns as is
-        self.assertEqual(p, non_existing_path)
+        assert p == non_existing_path
 
     @pytest.mark.skipif(platform.system() != "Windows", reason="Requires Windows")
     def test_case_partial_exists(self):
@@ -34,51 +32,45 @@ class GetCasedPath(unittest.TestCase):
 
         non_existing_path = os.path.join(folder, "myfolder", "subfolder", "not-existing")
         # The first part of the path will be properly cased.
-        self.assertEqual(os.path.join(p1, "not-existing"),
-                         get_cased_path(non_existing_path))
+        assert os.path.join(p1, "not-existing") == get_cased_path(non_existing_path)
 
 
-class UnixPathTest(unittest.TestCase):
+class TestUnixPath:
 
     def test_none(self):
-        self.assertEqual(None, subsystem_path(None, path=None))
+        assert None == subsystem_path(None, path=None)
 
     def test_msys_path(self):
-        self.assertEqual('/c/windows/system32', subsystem_path("msys2", 'C:\\Windows\\System32'))
+        assert '/c/windows/system32' == subsystem_path("msys2", 'C:\\Windows\\System32')
 
     def test_cygwin_path(self):
-        self.assertEqual('/cygdrive/c/windows/system32', subsystem_path("cygwin",
-                                                                        'C:\\Windows\\System32'))
+        assert '/cygdrive/c/windows/system32' == subsystem_path("cygwin",
+                                                               'C:\\Windows\\System32')
 
         # another drive
-        self.assertEqual('/cygdrive/d/work', subsystem_path("cygwin", "D:\\work"))
+        assert '/cygdrive/d/work' == subsystem_path("cygwin", "D:\\work")
 
         # path inside the cygwin
-        self.assertEqual('/home/.conan', subsystem_path("cygwin", '/home/.conan'))
-        self.assertEqual('/dev/null', subsystem_path("cygwin", '/dev/null'))
+        assert '/home/.conan' == subsystem_path("cygwin", '/home/.conan')
+        assert '/dev/null' == subsystem_path("cygwin", '/dev/null')
 
         # relative paths
-        self.assertEqual('./configure', subsystem_path("cygwin", './configure'))
-        self.assertEqual('../configure', subsystem_path("cygwin", '../configure'))
-        self.assertEqual('source_subfolder/configure',
-                         subsystem_path("cygwin", 'source_subfolder/configure'))
+        assert './configure' == subsystem_path("cygwin", './configure')
+        assert '../configure' == subsystem_path("cygwin", '../configure')
+        assert 'source_subfolder/configure' == subsystem_path("cygwin", 'source_subfolder/configure')
 
-        self.assertEqual('./configure', subsystem_path("cygwin", '.\\configure'))
-        self.assertEqual('../configure', subsystem_path("cygwin", '..\\configure'))
-        self.assertEqual('source_subfolder/configure',
-                         subsystem_path("cygwin", 'source_subfolder\\configure'))
+        assert './configure' == subsystem_path("cygwin", '.\\configure')
+        assert '../configure' == subsystem_path("cygwin", '..\\configure')
+        assert 'source_subfolder/configure' == subsystem_path("cygwin", 'source_subfolder\\configure')
 
         # already with cygdrive
-        self.assertEqual('/cygdrive/c/conan',
-                         subsystem_path("cygwin", '/cygdrive/c/conan'))
+        assert '/cygdrive/c/conan' == subsystem_path("cygwin", '/cygdrive/c/conan')
 
         # UNC (file share)
-        self.assertEqual('//server/share',
-                         subsystem_path("cygwin", "\\\\SERVER\\Share"))
+        assert '//server/share' == subsystem_path("cygwin", "\\\\SERVER\\Share")
 
         # long path
-        self.assertEqual('/cygdrive/c/windows/system32',
-                         subsystem_path("cygwin", '\\\\?\\C:\\Windows\\System32'))
+        assert '/cygdrive/c/windows/system32' == subsystem_path("cygwin", '\\\\?\\C:\\Windows\\System32')
 
     def test_wsl_path(self):
-        self.assertEqual('/mnt/c/Windows/System32', subsystem_path("wsl", 'C:\\Windows\\System32'))
+        assert '/mnt/c/Windows/System32' == subsystem_path("wsl", 'C:\\Windows\\System32')