diff --git a/README.rst b/README.rst
index 70448ec6f6e..ffe2c770f8f 100644
--- a/README.rst
+++ b/README.rst
@@ -119,7 +119,7 @@ Using tox
$ python -m tox
-It will install the needed requirements and launch `nose` skipping some heavy and slow tests.
+It will install the needed requirements and launch `pytest` skipping some heavy and slow tests.
If you want to run the full test suite:
.. code-block:: bash
@@ -180,7 +180,7 @@ You can run the actual tests like this:
.. code-block:: bash
- $ python -m nose .
+ $ python -m pytest .
There are a couple of test attributes defined, as ``slow`` that you can use
@@ -188,7 +188,7 @@ to filter the tests, and do not execute them:
.. code-block:: bash
- $ python -m nose . -a !slow
+ $ python -m pytest . -m "not slow"
A few minutes later it should print ``OK``:
@@ -204,16 +204,16 @@ To run specific tests, you can specify the test name too, something like:
.. code-block:: bash
- $ python -m nose conans.test.command.config_install_test:ConfigInstallTest.install_file_test --nocapture
+ $ python -m pytest conans/test/unittests/client/cmd/export_test.py::ExportTest::test_export_warning -s
-The ``--nocapture`` argument can be useful to see some output that otherwise is captured by nosetests.
+The ``-s`` argument can be useful to see some output that otherwise is captured by pytest.
Also, you can run tests against an instance of Artifactory. Those tests should add the attribute
``artifactory_ready``.
.. code-block:: bash
- $ python -m nose . -A artifactory_ready
+ $ python -m pytest . -m artifactory_ready
Some environment variables have to be defined to run them. For example, for an
Artifactory instance that is running on the localhost with default user and password configured, the
diff --git a/conans/requirements_dev.txt b/conans/requirements_dev.txt
index 0fc076f5e61..31362d4967d 100644
--- a/conans/requirements_dev.txt
+++ b/conans/requirements_dev.txt
@@ -1,4 +1,6 @@
nose>=1.3.7, <1.4.0
+pytest>=6.1.1, <7.0.0; python_version > '3.0'
+pytest>=4.6.11; python_version < '3.0'
parameterized>=0.6.3
mock>=1.3.0, <1.4.0
WebTest>=2.0.18, <2.1.0
diff --git a/conans/test/functional/build_helpers/cmake_configs_test.py b/conans/test/functional/build_helpers/cmake_configs_test.py
index daefad277ad..1004a0671e2 100644
--- a/conans/test/functional/build_helpers/cmake_configs_test.py
+++ b/conans/test/functional/build_helpers/cmake_configs_test.py
@@ -1,6 +1,7 @@
import os
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.test.utils.multi_config import multi_config_files
@@ -8,6 +9,7 @@
@attr("slow")
+@pytest.mark.slow
class CMakeConfigsTest(unittest.TestCase):
def test_test_package_configs(self):
diff --git a/conans/test/functional/build_helpers/cmake_flags_test.py b/conans/test/functional/build_helpers/cmake_flags_test.py
index aa1b82dda20..35c1a391d64 100644
--- a/conans/test/functional/build_helpers/cmake_flags_test.py
+++ b/conans/test/functional/build_helpers/cmake_flags_test.py
@@ -4,6 +4,7 @@
import unittest
from textwrap import dedent
+import pytest
from nose.plugins.attrib import attr
from parameterized.parameterized import parameterized
@@ -61,6 +62,7 @@ def package_info(self):
@attr("slow")
+@pytest.mark.slow
class CMakeFlagsTest(unittest.TestCase):
def _get_line(self, text, begin):
diff --git a/conans/test/functional/build_helpers/cmake_targets_test.py b/conans/test/functional/build_helpers/cmake_targets_test.py
index 1eff5f615e3..5803ac246d7 100644
--- a/conans/test/functional/build_helpers/cmake_targets_test.py
+++ b/conans/test/functional/build_helpers/cmake_targets_test.py
@@ -1,6 +1,7 @@
import platform
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.test.utils.tools import TestClient
@@ -47,6 +48,7 @@ def package(self):
@attr("slow")
+@pytest.mark.slow
class CMakeTargetsTest(unittest.TestCase):
def test_transitive_flags(self):
client = TestClient()
diff --git a/conans/test/functional/build_helpers/msbuild_test.py b/conans/test/functional/build_helpers/msbuild_test.py
index 871fb3100e3..ff639ff15de 100644
--- a/conans/test/functional/build_helpers/msbuild_test.py
+++ b/conans/test/functional/build_helpers/msbuild_test.py
@@ -3,6 +3,7 @@
import textwrap
import unittest
+import pytest
import six
from nose.plugins.attrib import attr
from parameterized import parameterized
@@ -10,15 +11,16 @@
from conans.client.tools.files import replace_in_file
from conans.model.ref import PackageReference
from conans.paths import CONANFILE
+from conans.test.utils.deprecation import catch_deprecation_warning
from conans.test.utils.tools import TestClient
from conans.test.utils.visual_project_files import get_vs_project_files
-from conans.test.utils.deprecation import catch_deprecation_warning
from conans.util.files import load
class MSBuildTest(unittest.TestCase):
@attr('slow')
+ @pytest.mark.slow
@unittest.skipUnless(platform.system() == "Windows" and six.PY3, "Requires MSBuild")
def test_build_vs_project(self):
conan_build_vs = """
@@ -101,6 +103,7 @@ def package(self):
self.assertTrue(os.path.exists(os.path.join(build_folder, "mp.props")))
@attr('slow')
+ @pytest.mark.slow
@unittest.skipUnless(platform.system() == "Windows", "Requires MSBuild")
def test_user_properties_file(self):
conan_build_vs = textwrap.dedent("""
@@ -153,6 +156,7 @@ def package(self):
self.assertIn("MultiThreadedDLL", content)
@attr('slow')
+ @pytest.mark.slow
@unittest.skipUnless(platform.system() == "Windows", "Requires MSBuild")
def test_user_properties_multifile(self):
conan_build_vs = textwrap.dedent("""
diff --git a/conans/test/functional/build_requires/profile_build_requires_testing_test.py b/conans/test/functional/build_requires/profile_build_requires_testing_test.py
index 1e40c6465a2..f0375450fbb 100644
--- a/conans/test/functional/build_requires/profile_build_requires_testing_test.py
+++ b/conans/test/functional/build_requires/profile_build_requires_testing_test.py
@@ -1,5 +1,6 @@
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
@@ -58,6 +59,7 @@ def build(self):
@attr("slow")
+@pytest.mark.slow
class BuildRequiresTest(unittest.TestCase):
def test_test_framework(self):
diff --git a/conans/test/functional/command/info/info_test.py b/conans/test/functional/command/info/info_test.py
index 578b3b3db58..5f9bab15aaf 100644
--- a/conans/test/functional/command/info/info_test.py
+++ b/conans/test/functional/command/info/info_test.py
@@ -600,14 +600,14 @@ class MyTest(ConanFile):
client.run("info ./subfolder --json=output.json")
output = json.loads(client.load('output.json'))[0]
- self.assertEquals(output['reference'], 'conanfile.py (Pkg/0.2)')
+ self.assertEqual(output['reference'], 'conanfile.py (Pkg/0.2)')
self.assertListEqual(output['license'], ['MIT', ])
- self.assertEquals(output['author'], 'John Doe')
+ self.assertEqual(output['author'], 'John Doe')
self.assertListEqual(output['topics'], ['foo', 'bar', 'qux'])
- self.assertEquals(output['url'], 'https://foo.bar.baz')
- self.assertEquals(output['homepage'], 'https://foo.bar.site')
+ self.assertEqual(output['url'], 'https://foo.bar.baz')
+ self.assertEqual(output['homepage'], 'https://foo.bar.site')
self.assertListEqual(output['provides'], ['libjpeg', 'libjpg'])
- self.assertEquals(output['deprecated'], 'other-pkg')
+ self.assertEqual(output['deprecated'], 'other-pkg')
def test_topics_graph(self):
diff --git a/conans/test/functional/command/test_command_test.py b/conans/test/functional/command/test_command_test.py
index e07a270e953..7d7397c08aa 100644
--- a/conans/test/functional/command/test_command_test.py
+++ b/conans/test/functional/command/test_command_test.py
@@ -2,6 +2,7 @@
import time
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.model.ref import PackageReference
@@ -12,6 +13,7 @@
@attr("slow")
+@pytest.mark.slow
class ConanTestTest(unittest.TestCase):
def test_partial_reference(self):
diff --git a/conans/test/functional/command/upload/upload_test.py b/conans/test/functional/command/upload/upload_test.py
index 1ecabc74922..abd77cf46a0 100644
--- a/conans/test/functional/command/upload/upload_test.py
+++ b/conans/test/functional/command/upload/upload_test.py
@@ -1,10 +1,11 @@
+import itertools
import os
import platform
import stat
import unittest
from collections import OrderedDict
-import itertools
+import pytest
import requests
from mock import patch
from nose.plugins.attrib import attr
@@ -19,7 +20,6 @@
from conans.test.utils.tools import NO_SETTINGS_PACKAGE_ID, TestClient, TestServer, \
TurboTestClient, GenConanfile, TestRequester, TestingResponse
from conans.util.env_reader import get_env
-
from conans.util.files import gzopen_without_timestamps, is_dirty, save, set_dirty
conanfile = """from conans import ConanFile
@@ -67,6 +67,7 @@ def test_upload_dirty(self):
client.run("upload * --all --confirm")
@attr("artifactory_ready")
+ @pytest.mark.artifactory_ready
def test_upload_force(self):
ref = ConanFileReference.loads("Hello/0.1@conan/testing")
client = TurboTestClient(servers={"default": TestServer()})
diff --git a/conans/test/functional/conan_build_info/test_build_info_extraction.py b/conans/test/functional/conan_build_info/test_build_info_extraction.py
index f9b6b5e0e80..71397c792c8 100644
--- a/conans/test/functional/conan_build_info/test_build_info_extraction.py
+++ b/conans/test/functional/conan_build_info/test_build_info_extraction.py
@@ -4,6 +4,7 @@
import unittest
from collections import OrderedDict
+import pytest
import six
from nose.plugins.attrib import attr
@@ -126,6 +127,7 @@ def test_cross_remotes(self):
self.assertEqual(0, len(module["dependencies"]))
@attr('ide_fail')
+ @pytest.mark.ide_fail
def test_trace_command(self):
from conans.build_info.command import run
trace_file = os.path.join(temp_folder(), "conan_trace.log")
diff --git a/conans/test/functional/conanfile/conan_data_test.py b/conans/test/functional/conanfile/conan_data_test.py
index b04735ccc97..4476ad50e0c 100644
--- a/conans/test/functional/conanfile/conan_data_test.py
+++ b/conans/test/functional/conanfile/conan_data_test.py
@@ -2,6 +2,7 @@
import textwrap
import unittest
+import pytest
import yaml
from bottle import static_file
from nose.plugins.attrib import attr
@@ -87,6 +88,7 @@ def package_info(self):
self.assertIn("My URL:", client.out)
@attr("slow")
+ @pytest.mark.slow
@attr('local_bottle')
def test_conan_data_as_source(self):
tgz_path = tgz_with_contents({"foo.txt": "foo"})
diff --git a/conans/test/functional/environment/apply_environment_test.py b/conans/test/functional/environment/apply_environment_test.py
index 64f0a1b46b3..9185cb6b162 100644
--- a/conans/test/functional/environment/apply_environment_test.py
+++ b/conans/test/functional/environment/apply_environment_test.py
@@ -2,6 +2,7 @@
import platform
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.client import tools
@@ -17,6 +18,7 @@
class ConanEnvTest(unittest.TestCase):
@attr('slow')
+ @pytest.mark.slow
def test_shared_in_current_directory(self):
"""
- There is a package building a shared library
diff --git a/conans/test/functional/generators/cmake_components_test.py b/conans/test/functional/generators/cmake_components_test.py
index a7eded0551e..f9a1a1d3f50 100644
--- a/conans/test/functional/generators/cmake_components_test.py
+++ b/conans/test/functional/generators/cmake_components_test.py
@@ -1,6 +1,7 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.model.ref import ConanFileReference
@@ -9,6 +10,7 @@
@attr('slow')
+@pytest.mark.slow
class CMakeGeneratorsWithComponentsTest(unittest.TestCase):
@staticmethod
diff --git a/conans/test/functional/generators/cmake_find_package_multi_test.py b/conans/test/functional/generators/cmake_find_package_multi_test.py
index 28932bc307e..d59b0bcf85e 100644
--- a/conans/test/functional/generators/cmake_find_package_multi_test.py
+++ b/conans/test/functional/generators/cmake_find_package_multi_test.py
@@ -3,6 +3,7 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
from parameterized import parameterized
@@ -12,6 +13,7 @@
@attr('slow')
+@pytest.mark.slow
class CMakeFindPathMultiGeneratorTest(unittest.TestCase):
def test_native_export_multi(self):
diff --git a/conans/test/functional/generators/cmake_find_package_test.py b/conans/test/functional/generators/cmake_find_package_test.py
index 18913697487..3315487f1e7 100644
--- a/conans/test/functional/generators/cmake_find_package_test.py
+++ b/conans/test/functional/generators/cmake_find_package_test.py
@@ -3,6 +3,7 @@
import textwrap
import unittest
+import pytest
import six
from nose.plugins.attrib import attr
@@ -14,6 +15,7 @@
@attr('slow')
+@pytest.mark.slow
class CMakeFindPathGeneratorTest(unittest.TestCase):
def test_cmake_find_package_system_libs(self):
diff --git a/conans/test/functional/generators/cmake_multi_test.py b/conans/test/functional/generators/cmake_multi_test.py
index c023451ab30..cf6cfb6dd72 100644
--- a/conans/test/functional/generators/cmake_multi_test.py
+++ b/conans/test/functional/generators/cmake_multi_test.py
@@ -3,9 +3,10 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
-from conans.client.tools import load, remove_from_path
+from conans.client.tools import remove_from_path
from conans.test.utils.multi_config import multi_config_files
from conans.test.utils.tools import TestClient
@@ -132,9 +133,11 @@ def package_files(name, deps=None):
@attr("slow")
+@pytest.mark.slow
class CMakeMultiTest(unittest.TestCase):
@attr("mingw")
+ @pytest.mark.tool_mingw
def test_cmake_multi_find(self):
if platform.system() not in ["Windows", "Linux"]:
return
diff --git a/conans/test/functional/generators/cmake_test.py b/conans/test/functional/generators/cmake_test.py
index d595b252a02..4aa93c44e8a 100644
--- a/conans/test/functional/generators/cmake_test.py
+++ b/conans/test/functional/generators/cmake_test.py
@@ -3,6 +3,7 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.client.tools import replace_in_file
@@ -72,6 +73,7 @@ def package_id(self):
self.assertIn("Conan: Checking correct version:", client.out)
@attr("slow")
+ @pytest.mark.slow
@unittest.skipUnless(platform.system() == "Windows", "Requires MSBuild")
def test_skip_check_if_toolset(self):
file_content = textwrap.dedent("""
@@ -102,6 +104,7 @@ def build(self):
self.assertIn("Conan: Skipping compiler check: Declared 'compiler.toolset'", client.out)
@attr('slow')
+ @pytest.mark.slow
def test_no_output(self):
client = TestClient()
client.run("new Test/1.0 --sources")
diff --git a/conans/test/functional/generators/components/cmake_find_package_multi_test.py b/conans/test/functional/generators/components/cmake_find_package_multi_test.py
index 652a49b7974..70601a5fbd4 100644
--- a/conans/test/functional/generators/components/cmake_find_package_multi_test.py
+++ b/conans/test/functional/generators/components/cmake_find_package_multi_test.py
@@ -3,6 +3,7 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.model.ref import ConanFileReference
@@ -11,6 +12,7 @@
@attr('slow')
+@pytest.mark.slow
class CMakeGeneratorsWithComponentsTest(unittest.TestCase):
@staticmethod
diff --git a/conans/test/functional/generators/make_test.py b/conans/test/functional/generators/make_test.py
index dce31685e2f..340d6e1ee39 100644
--- a/conans/test/functional/generators/make_test.py
+++ b/conans/test/functional/generators/make_test.py
@@ -2,6 +2,7 @@
import platform
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.client.tools import replace_in_file
@@ -11,6 +12,7 @@
class MakeGeneratorTest(unittest.TestCase):
@attr('slow')
+ @pytest.mark.slow
@unittest.skipUnless(platform.system() == "Linux", "Requires make")
def test_complete_creation_reuse(self):
client = TestClient(path_with_spaces=False)
diff --git a/conans/test/functional/generators/msbuild_test.py b/conans/test/functional/generators/msbuild_test.py
index 95c11aa6960..91615474f34 100644
--- a/conans/test/functional/generators/msbuild_test.py
+++ b/conans/test/functional/generators/msbuild_test.py
@@ -2,13 +2,13 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.test.utils.genconanfile import GenConanfile
from conans.test.utils.tools import TestClient
-
sln_file = r"""
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
@@ -415,6 +415,7 @@
class MSBuildGeneratorTest(unittest.TestCase):
@attr('slow')
+ @pytest.mark.slow
def test_msbuild_generator(self):
client = TestClient()
# Upload to alternative server Hello0 but Hello1 to the default
diff --git a/conans/test/functional/generators/premake_test.py b/conans/test/functional/generators/premake_test.py
index 7f1fbd44750..fca15b7f266 100644
--- a/conans/test/functional/generators/premake_test.py
+++ b/conans/test/functional/generators/premake_test.py
@@ -1,15 +1,15 @@
-import os
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
-from conans import load
from conans.client.tools import which
from conans.test.utils.tools import TestClient
@attr("premake")
+@pytest.mark.tool_premake
@unittest.skipIf(which("premake5") is None, "Needs premake5")
class PremakeGeneratorTest(unittest.TestCase):
diff --git a/conans/test/functional/generators/visual_studio_multi_test.py b/conans/test/functional/generators/visual_studio_multi_test.py
index 2311c2c19ed..45ac131f1ec 100644
--- a/conans/test/functional/generators/visual_studio_multi_test.py
+++ b/conans/test/functional/generators/visual_studio_multi_test.py
@@ -4,6 +4,7 @@
import platform
import unittest
+import pytest
from nose.plugins.attrib import attr
from parameterized import parameterized
@@ -58,6 +59,7 @@ def package_info(self):
@attr('slow')
+@pytest.mark.slow
@unittest.skipUnless(platform.system() == "Windows", "Requires MSBuild")
class VisualStudioMultiTest(unittest.TestCase):
diff --git a/conans/test/functional/generators/visual_studio_test.py b/conans/test/functional/generators/visual_studio_test.py
index 229ca6e7c15..83290647587 100644
--- a/conans/test/functional/generators/visual_studio_test.py
+++ b/conans/test/functional/generators/visual_studio_test.py
@@ -5,12 +5,12 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.test.utils.tools import TestClient
from conans.test.utils.visual_project_files import get_vs_project_files
-
main_cpp = r"""#include
int main(){
hello();
@@ -27,6 +27,7 @@
class VisualStudioTest(unittest.TestCase):
@attr('slow')
+ @pytest.mark.slow
@unittest.skipUnless(platform.system() == "Windows", "Requires MSBuild")
def test_build_vs_project_with_a(self):
client = TestClient()
diff --git a/conans/test/functional/graph/diamond_test.py b/conans/test/functional/graph/diamond_test.py
index c012ebba102..cf0060048ab 100644
--- a/conans/test/functional/graph/diamond_test.py
+++ b/conans/test/functional/graph/diamond_test.py
@@ -2,6 +2,7 @@
import platform
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.client.generators.text import TXTGenerator
@@ -12,6 +13,7 @@
@attr("slow")
+@pytest.mark.slow
class DiamondTest(unittest.TestCase):
def setUp(self):
diff --git a/conans/test/functional/graph/private_deps_test.py b/conans/test/functional/graph/private_deps_test.py
index 3a2a662d487..a2a019653e8 100644
--- a/conans/test/functional/graph/private_deps_test.py
+++ b/conans/test/functional/graph/private_deps_test.py
@@ -1,6 +1,7 @@
import os
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.model.info import ConanInfo
@@ -198,6 +199,7 @@ def test_private_dont_skip(self):
@attr("slow")
+@pytest.mark.slow
class PrivateDepsTest(unittest.TestCase):
def setUp(self):
diff --git a/conans/test/functional/remote/rest_api_test.py b/conans/test/functional/remote/rest_api_test.py
index c4f00568a60..068ddd20c7b 100644
--- a/conans/test/functional/remote/rest_api_test.py
+++ b/conans/test/functional/remote/rest_api_test.py
@@ -2,6 +2,7 @@
import platform
import unittest
+import pytest
import requests
from mock import Mock
from nose.plugins.attrib import attr
@@ -19,9 +20,9 @@
from conans.model.ref import ConanFileReference, PackageReference
from conans.paths import CONANFILE, CONANINFO, CONAN_MANIFEST
from conans.test.utils.cpp_test_files import cpp_hello_source_files
+from conans.test.utils.mocks import LocalDBMock, TestBufferConanOutput
from conans.test.utils.server_launcher import TestServerLauncher
from conans.test.utils.test_files import temp_folder
-from conans.test.utils.mocks import LocalDBMock, TestBufferConanOutput
from conans.util.env_reader import get_env
from conans.util.files import md5, save
@@ -55,7 +56,9 @@ def test_relative_url_completion(self):
@attr('slow')
+@pytest.mark.slow
@attr('rest_api')
+@pytest.mark.rest_api
class RestApiTest(unittest.TestCase):
"""Open a real server (sockets) to test rest_api function."""
diff --git a/conans/test/functional/revisions_test.py b/conans/test/functional/revisions_test.py
index c4548e4daf3..d760a3cf2bf 100644
--- a/conans/test/functional/revisions_test.py
+++ b/conans/test/functional/revisions_test.py
@@ -1,9 +1,10 @@
-import time
-from collections import OrderedDict
-
import json
import os
+import time
import unittest
+from collections import OrderedDict
+
+import pytest
from nose.plugins.attrib import attr
from parameterized.parameterized import parameterized
@@ -16,6 +17,7 @@
@attr("artifactory_ready")
+@pytest.mark.artifactory_ready
@unittest.skipUnless(get_env("TESTING_REVISIONS_ENABLED", False), "Only revisions")
class InstallingPackagesWithRevisionsTest(unittest.TestCase):
@@ -1349,6 +1351,7 @@ def test_auto_revision_without_commits(self):
client.out)
@attr("svn")
+ @pytest.mark.tool_svn
def test_auto_revision_even_without_scm_svn(self):
"""Even without using the scm feature, the revision is detected from repo.
Also while we continue working in local, the revision doesn't change, so the packages
diff --git a/conans/test/functional/scm/issues/test_svn_tag.py b/conans/test/functional/scm/issues/test_svn_tag.py
index 2672eda3ab1..e7fb0ce040a 100644
--- a/conans/test/functional/scm/issues/test_svn_tag.py
+++ b/conans/test/functional/scm/issues/test_svn_tag.py
@@ -3,15 +3,17 @@
import os
import textwrap
+import pytest
from nose.plugins.attrib import attr
from conans.model.ref import ConanFileReference
+from conans.test.utils.scm import SVNLocalRepoTestCase
from conans.test.utils.tools import TestClient, \
load
-from conans.test.utils.scm import SVNLocalRepoTestCase
@attr('svn')
+@pytest.mark.tool_svn
class SVNTaggedComponentTest(SVNLocalRepoTestCase):
# Reproducing https://github.com/conan-io/conan/issues/5017
diff --git a/conans/test/functional/scm/scm_test.py b/conans/test/functional/scm/scm_test.py
index 7bcf49a3020..e2740956ab6 100644
--- a/conans/test/functional/scm/scm_test.py
+++ b/conans/test/functional/scm/scm_test.py
@@ -3,6 +3,7 @@
import unittest
from collections import namedtuple
+import pytest
from nose.plugins.attrib import attr
from parameterized.parameterized import parameterized
@@ -10,10 +11,10 @@
from conans.client.tools.win import get_cased_path
from conans.model.ref import ConanFileReference, PackageReference
from conans.model.scm import SCMData
+from conans.test.utils.scm import create_local_git_repo, SVNLocalRepoTestCase
from conans.test.utils.test_files import temp_folder
from conans.test.utils.tools import NO_SETTINGS_PACKAGE_ID, TestClient, \
TestServer, GenConanfile
-from conans.test.utils.scm import create_local_git_repo, SVNLocalRepoTestCase
from conans.util.files import load, rmdir, save, to_file_bytes
base = '''
@@ -49,6 +50,7 @@ def _quoted(item):
@attr('git')
+@pytest.mark.tool_git
class GitSCMTest(unittest.TestCase):
def setUp(self):
@@ -632,6 +634,7 @@ def build(self):
@attr('svn')
+@pytest.mark.tool_svn
class SVNSCMTest(SVNLocalRepoTestCase):
def setUp(self):
@@ -987,6 +990,7 @@ def build(self):
@attr('svn')
+@pytest.mark.tool_svn
class SCMSVNWithLockedFilesTest(SVNLocalRepoTestCase):
def test_propset_own(self):
diff --git a/conans/test/functional/scm/test_command_export.py b/conans/test/functional/scm/test_command_export.py
index dc38aca34cc..8c2a8bdf359 100644
--- a/conans/test/functional/scm/test_command_export.py
+++ b/conans/test/functional/scm/test_command_export.py
@@ -4,14 +4,16 @@
import textwrap
import unittest
-from parameterized import parameterized
+import pytest
from nose.plugins.attrib import attr
+from parameterized import parameterized
-from conans.test.utils.tools import TestClient
from conans.test.utils.scm import create_local_git_repo
+from conans.test.utils.tools import TestClient
@attr("svn")
+@pytest.mark.tool_svn
class ExportErrorCommandTestCase(unittest.TestCase):
conanfile = textwrap.dedent("""\
from conans import ConanFile
diff --git a/conans/test/functional/scm/workflows/test_conanfile_in_repo_root.py b/conans/test/functional/scm/workflows/test_conanfile_in_repo_root.py
index db656d628e0..4bcf93a0938 100644
--- a/conans/test/functional/scm/workflows/test_conanfile_in_repo_root.py
+++ b/conans/test/functional/scm/workflows/test_conanfile_in_repo_root.py
@@ -3,11 +3,12 @@
import os
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.test.functional.scm.workflows.common import TestWorkflow
-from conans.test.utils.tools import TestClient
from conans.test.utils.scm import create_local_git_repo, SVNLocalRepoTestCase
+from conans.test.utils.tools import TestClient
class ConanfileInRepoRoot(TestWorkflow):
@@ -18,6 +19,7 @@ class ConanfileInRepoRoot(TestWorkflow):
@attr("svn")
+@pytest.mark.tool_svn
class SVNConanfileInRepoRootTest(ConanfileInRepoRoot, SVNLocalRepoTestCase):
""" Test SCM url='auto' with SVN, it can only work if conanfile is in the root of the repo
diff --git a/conans/test/functional/scm/workflows/test_conanfile_in_subfolder.py b/conans/test/functional/scm/workflows/test_conanfile_in_subfolder.py
index b389da1c28f..7bb585bbc4c 100644
--- a/conans/test/functional/scm/workflows/test_conanfile_in_subfolder.py
+++ b/conans/test/functional/scm/workflows/test_conanfile_in_subfolder.py
@@ -4,11 +4,12 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.test.functional.scm.workflows.common import TestWorkflow
-from conans.test.utils.tools import TestClient
from conans.test.utils.scm import create_local_git_repo, SVNLocalRepoTestCase
+from conans.test.utils.tools import TestClient
class ConanfileInSubfolder(TestWorkflow):
@@ -19,6 +20,7 @@ class ConanfileInSubfolder(TestWorkflow):
@attr("svn")
+@pytest.mark.tool_svn
class SVNConanfileInSubfolderTest(ConanfileInSubfolder, SVNLocalRepoTestCase):
extra_header = textwrap.dedent("""\
diff --git a/conans/test/functional/scm/workflows/test_scm_subfolder.py b/conans/test/functional/scm/workflows/test_scm_subfolder.py
index 852cfb21394..c5cae5f4bd6 100644
--- a/conans/test/functional/scm/workflows/test_scm_subfolder.py
+++ b/conans/test/functional/scm/workflows/test_scm_subfolder.py
@@ -4,11 +4,12 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.test.functional.scm.workflows.common import TestWorkflow
-from conans.test.utils.tools import TestClient
from conans.test.utils.scm import create_local_git_repo, SVNLocalRepoTestCase
+from conans.test.utils.tools import TestClient
class SCMSubfolder(TestWorkflow):
@@ -22,6 +23,7 @@ class SCMSubfolder(TestWorkflow):
@attr("svn")
+@pytest.mark.tool_svn
class SVNConanfileInRepoRootTest(SCMSubfolder, SVNLocalRepoTestCase):
""" Test SCM url='auto' with SVN, it can only work if conanfile is in the root of the repo
diff --git a/conans/test/functional/toolchain/test_basic.py b/conans/test/functional/toolchain/test_basic.py
index 73c59823674..022bd485ce0 100644
--- a/conans/test/functional/toolchain/test_basic.py
+++ b/conans/test/functional/toolchain/test_basic.py
@@ -2,12 +2,14 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.test.utils.tools import TestClient
@attr("toolchain")
+@pytest.mark.toolchain
class BasicTest(unittest.TestCase):
def test_basic(self):
diff --git a/conans/test/functional/toolchain/test_cmake.py b/conans/test/functional/toolchain/test_cmake.py
index 8eb08da625c..6cd378a2090 100644
--- a/conans/test/functional/toolchain/test_cmake.py
+++ b/conans/test/functional/toolchain/test_cmake.py
@@ -4,6 +4,7 @@
import time
import unittest
+import pytest
from nose.plugins.attrib import attr
from parameterized.parameterized import parameterized
@@ -12,6 +13,7 @@
@attr("toolchain")
+@pytest.mark.toolchain
class Base(unittest.TestCase):
conanfile = textwrap.dedent("""
@@ -371,6 +373,7 @@ def _verify_out(marker=">>"):
@attr("toolchain")
+@pytest.mark.toolchain
class CMakeInstallTest(unittest.TestCase):
def test_install(self):
diff --git a/conans/test/functional/toolchain/test_make.py b/conans/test/functional/toolchain/test_make.py
index a4baa85cdc6..94d2b5eb86c 100644
--- a/conans/test/functional/toolchain/test_make.py
+++ b/conans/test/functional/toolchain/test_make.py
@@ -3,18 +3,19 @@
import textwrap
import unittest
+import pytest
from nose.plugins.attrib import attr
-
-from conans.test.utils.tools import TestClient
-from conans.client.tools import which
-
from parameterized.parameterized import parameterized
+from conans.client.tools import which
+from conans.test.utils.tools import TestClient
from conans.util.files import mkdir
@attr("slow")
@attr("toolchain")
+@pytest.mark.slow
+@pytest.mark.toolchain
class MakeToolchainTest(unittest.TestCase):
@parameterized.expand([
("exe", "Release"),
diff --git a/conans/test/integration/basic_build_test.py b/conans/test/integration/basic_build_test.py
index e97fb85272e..b128f2cc5e6 100644
--- a/conans/test/integration/basic_build_test.py
+++ b/conans/test/integration/basic_build_test.py
@@ -2,6 +2,7 @@
import platform
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.model.info import ConanInfo
@@ -12,6 +13,7 @@
@attr("slow")
+@pytest.mark.slow
class BasicBuildTest(unittest.TestCase):
def test_build_cmake(self):
diff --git a/conans/test/integration/complete_test.py b/conans/test/integration/complete_test.py
index bc1683519e0..a89402998ca 100644
--- a/conans/test/integration/complete_test.py
+++ b/conans/test/integration/complete_test.py
@@ -2,6 +2,7 @@
import time
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.model.ref import ConanFileReference, PackageReference
@@ -11,6 +12,7 @@
@attr("slow")
+@pytest.mark.slow
class CompleteFlowTest(unittest.TestCase):
def test_reuse_complete_urls(self):
diff --git a/conans/test/integration/shared_chain_test.py b/conans/test/integration/shared_chain_test.py
index 36ddde6ce8e..92359e5e728 100644
--- a/conans/test/integration/shared_chain_test.py
+++ b/conans/test/integration/shared_chain_test.py
@@ -2,6 +2,7 @@
import shutil
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
@@ -10,6 +11,7 @@
@attr("slow")
+@pytest.mark.slow
class SharedChainTest(unittest.TestCase):
def setUp(self):
diff --git a/conans/test/unittests/client/build/cpp_std_flags_test.py b/conans/test/unittests/client/build/cpp_std_flags_test.py
index a78b6f6d1cf..6ae000bfa0f 100644
--- a/conans/test/unittests/client/build/cpp_std_flags_test.py
+++ b/conans/test/unittests/client/build/cpp_std_flags_test.py
@@ -216,81 +216,81 @@ def test_visual_cppstd_defaults(self):
self.assertEqual(_make_cppstd_default("Visual Studio", "15"), "14")
def test_intel_visual_cppstd_defaults(self):
- self.assertEquals(_make_cppstd_default("intel", "19", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_default("intel", "19", "Visual Studio"), None)
def test_intel_gcc_cppstd_defaults(self):
- self.assertEquals(_make_cppstd_default("intel", "19", "gcc"), 'gnu98')
+ self.assertEqual(_make_cppstd_default("intel", "19", "gcc"), 'gnu98')
def test_intel_visual_cppstd_flag(self):
- self.assertEquals(_make_cppstd_flag("intel", "19.1", "gnu98", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "19.1", "11", "Visual Studio"), '/Qstd=c++11')
- self.assertEquals(_make_cppstd_flag("intel", "19.1", "14", "Visual Studio"), '/Qstd=c++14')
- self.assertEquals(_make_cppstd_flag("intel", "19.1", "17", "Visual Studio"), '/Qstd=c++17')
- self.assertEquals(_make_cppstd_flag("intel", "19.1", "20", "Visual Studio"), '/Qstd=c++20')
-
- self.assertEquals(_make_cppstd_flag("intel", "19", "gnu98", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "19", "11", "Visual Studio"), '/Qstd=c++11')
- self.assertEquals(_make_cppstd_flag("intel", "19", "14", "Visual Studio"), '/Qstd=c++14')
- self.assertEquals(_make_cppstd_flag("intel", "19", "17", "Visual Studio"), '/Qstd=c++17')
- self.assertEquals(_make_cppstd_flag("intel", "19", "20", "Visual Studio"), None)
-
- self.assertEquals(_make_cppstd_flag("intel", "17", "gnu98", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "17", "11", "Visual Studio"), '/Qstd=c++11')
- self.assertEquals(_make_cppstd_flag("intel", "17", "14", "Visual Studio"), '/Qstd=c++14')
- self.assertEquals(_make_cppstd_flag("intel", "17", "17", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "17", "20", "Visual Studio"), None)
-
- self.assertEquals(_make_cppstd_flag("intel", "15", "gnu98", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "15", "11", "Visual Studio"), '/Qstd=c++11')
- self.assertEquals(_make_cppstd_flag("intel", "15", "14", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "15", "17", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "15", "20", "Visual Studio"), None)
-
- self.assertEquals(_make_cppstd_flag("intel", "12", "gnu98", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "12", "11", "Visual Studio"), '/Qstd=c++0x')
- self.assertEquals(_make_cppstd_flag("intel", "12", "14", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "12", "17", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "12", "20", "Visual Studio"), None)
-
- self.assertEquals(_make_cppstd_flag("intel", "11", "gnu98", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "11", "11", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "11", "14", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "11", "17", "Visual Studio"), None)
- self.assertEquals(_make_cppstd_flag("intel", "11", "20", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "19.1", "gnu98", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "19.1", "11", "Visual Studio"), '/Qstd=c++11')
+ self.assertEqual(_make_cppstd_flag("intel", "19.1", "14", "Visual Studio"), '/Qstd=c++14')
+ self.assertEqual(_make_cppstd_flag("intel", "19.1", "17", "Visual Studio"), '/Qstd=c++17')
+ self.assertEqual(_make_cppstd_flag("intel", "19.1", "20", "Visual Studio"), '/Qstd=c++20')
+
+ self.assertEqual(_make_cppstd_flag("intel", "19", "gnu98", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "19", "11", "Visual Studio"), '/Qstd=c++11')
+ self.assertEqual(_make_cppstd_flag("intel", "19", "14", "Visual Studio"), '/Qstd=c++14')
+ self.assertEqual(_make_cppstd_flag("intel", "19", "17", "Visual Studio"), '/Qstd=c++17')
+ self.assertEqual(_make_cppstd_flag("intel", "19", "20", "Visual Studio"), None)
+
+ self.assertEqual(_make_cppstd_flag("intel", "17", "gnu98", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "17", "11", "Visual Studio"), '/Qstd=c++11')
+ self.assertEqual(_make_cppstd_flag("intel", "17", "14", "Visual Studio"), '/Qstd=c++14')
+ self.assertEqual(_make_cppstd_flag("intel", "17", "17", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "17", "20", "Visual Studio"), None)
+
+ self.assertEqual(_make_cppstd_flag("intel", "15", "gnu98", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "15", "11", "Visual Studio"), '/Qstd=c++11')
+ self.assertEqual(_make_cppstd_flag("intel", "15", "14", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "15", "17", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "15", "20", "Visual Studio"), None)
+
+ self.assertEqual(_make_cppstd_flag("intel", "12", "gnu98", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "12", "11", "Visual Studio"), '/Qstd=c++0x')
+ self.assertEqual(_make_cppstd_flag("intel", "12", "14", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "12", "17", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "12", "20", "Visual Studio"), None)
+
+ self.assertEqual(_make_cppstd_flag("intel", "11", "gnu98", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "11", "11", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "11", "14", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "11", "17", "Visual Studio"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "11", "20", "Visual Studio"), None)
def test_intel_gcc_cppstd_flag(self):
- self.assertEquals(_make_cppstd_flag("intel", "19.1", "gnu98", "gcc"), '-std=gnu++98')
- self.assertEquals(_make_cppstd_flag("intel", "19.1", "11", "gcc"), '-std=c++11')
- self.assertEquals(_make_cppstd_flag("intel", "19.1", "14", "gcc"), '-std=c++14')
- self.assertEquals(_make_cppstd_flag("intel", "19.1", "17", "gcc"), '-std=c++17')
- self.assertEquals(_make_cppstd_flag("intel", "19.1", "20", "gcc"), '-std=c++20')
-
- self.assertEquals(_make_cppstd_flag("intel", "19", "gnu98", "gcc"), '-std=gnu++98')
- self.assertEquals(_make_cppstd_flag("intel", "19", "11", "gcc"), '-std=c++11')
- self.assertEquals(_make_cppstd_flag("intel", "19", "14", "gcc"), '-std=c++14')
- self.assertEquals(_make_cppstd_flag("intel", "19", "17", "gcc"), '-std=c++17')
- self.assertEquals(_make_cppstd_flag("intel", "19", "20", "gcc"), None)
-
- self.assertEquals(_make_cppstd_flag("intel", "17", "gnu98", "gcc"), '-std=gnu++98')
- self.assertEquals(_make_cppstd_flag("intel", "17", "11", "gcc"), '-std=c++11')
- self.assertEquals(_make_cppstd_flag("intel", "17", "14", "gcc"), '-std=c++14')
- self.assertEquals(_make_cppstd_flag("intel", "17", "17", "gcc"), None)
- self.assertEquals(_make_cppstd_flag("intel", "17", "20", "gcc"), None)
-
- self.assertEquals(_make_cppstd_flag("intel", "15", "gnu98", "gcc"), '-std=gnu++98')
- self.assertEquals(_make_cppstd_flag("intel", "15", "11", "gcc"), '-std=c++11')
- self.assertEquals(_make_cppstd_flag("intel", "15", "14", "gcc"), None)
- self.assertEquals(_make_cppstd_flag("intel", "15", "17", "gcc"), None)
- self.assertEquals(_make_cppstd_flag("intel", "15", "20", "gcc"), None)
-
- self.assertEquals(_make_cppstd_flag("intel", "12", "gnu98", "gcc"), '-std=gnu++98')
- self.assertEquals(_make_cppstd_flag("intel", "12", "11", "gcc"), '-std=c++0x')
- self.assertEquals(_make_cppstd_flag("intel", "12", "14", "gcc"), None)
- self.assertEquals(_make_cppstd_flag("intel", "12", "17", "gcc"), None)
- self.assertEquals(_make_cppstd_flag("intel", "12", "20", "gcc"), None)
-
- self.assertEquals(_make_cppstd_flag("intel", "11", "gnu98", "gcc"), '-std=gnu++98')
- self.assertEquals(_make_cppstd_flag("intel", "11", "11", "gcc"), None)
- self.assertEquals(_make_cppstd_flag("intel", "11", "14", "gcc"), None)
- self.assertEquals(_make_cppstd_flag("intel", "11", "17", "gcc"), None)
- self.assertEquals(_make_cppstd_flag("intel", "11", "20", "gcc"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "19.1", "gnu98", "gcc"), '-std=gnu++98')
+ self.assertEqual(_make_cppstd_flag("intel", "19.1", "11", "gcc"), '-std=c++11')
+ self.assertEqual(_make_cppstd_flag("intel", "19.1", "14", "gcc"), '-std=c++14')
+ self.assertEqual(_make_cppstd_flag("intel", "19.1", "17", "gcc"), '-std=c++17')
+ self.assertEqual(_make_cppstd_flag("intel", "19.1", "20", "gcc"), '-std=c++20')
+
+ self.assertEqual(_make_cppstd_flag("intel", "19", "gnu98", "gcc"), '-std=gnu++98')
+ self.assertEqual(_make_cppstd_flag("intel", "19", "11", "gcc"), '-std=c++11')
+ self.assertEqual(_make_cppstd_flag("intel", "19", "14", "gcc"), '-std=c++14')
+ self.assertEqual(_make_cppstd_flag("intel", "19", "17", "gcc"), '-std=c++17')
+ self.assertEqual(_make_cppstd_flag("intel", "19", "20", "gcc"), None)
+
+ self.assertEqual(_make_cppstd_flag("intel", "17", "gnu98", "gcc"), '-std=gnu++98')
+ self.assertEqual(_make_cppstd_flag("intel", "17", "11", "gcc"), '-std=c++11')
+ self.assertEqual(_make_cppstd_flag("intel", "17", "14", "gcc"), '-std=c++14')
+ self.assertEqual(_make_cppstd_flag("intel", "17", "17", "gcc"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "17", "20", "gcc"), None)
+
+ self.assertEqual(_make_cppstd_flag("intel", "15", "gnu98", "gcc"), '-std=gnu++98')
+ self.assertEqual(_make_cppstd_flag("intel", "15", "11", "gcc"), '-std=c++11')
+ self.assertEqual(_make_cppstd_flag("intel", "15", "14", "gcc"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "15", "17", "gcc"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "15", "20", "gcc"), None)
+
+ self.assertEqual(_make_cppstd_flag("intel", "12", "gnu98", "gcc"), '-std=gnu++98')
+ self.assertEqual(_make_cppstd_flag("intel", "12", "11", "gcc"), '-std=c++0x')
+ self.assertEqual(_make_cppstd_flag("intel", "12", "14", "gcc"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "12", "17", "gcc"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "12", "20", "gcc"), None)
+
+ self.assertEqual(_make_cppstd_flag("intel", "11", "gnu98", "gcc"), '-std=gnu++98')
+ self.assertEqual(_make_cppstd_flag("intel", "11", "11", "gcc"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "11", "14", "gcc"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "11", "17", "gcc"), None)
+ self.assertEqual(_make_cppstd_flag("intel", "11", "20", "gcc"), None)
diff --git a/conans/test/unittests/client/generators/visual_studio_multi_test.py b/conans/test/unittests/client/generators/visual_studio_multi_test.py
index 7b208ea11d8..44c639ecd34 100644
--- a/conans/test/unittests/client/generators/visual_studio_multi_test.py
+++ b/conans/test/unittests/client/generators/visual_studio_multi_test.py
@@ -1,6 +1,7 @@
import os
import unittest
+import pytest
from nose.plugins.attrib import attr
from parameterized import parameterized
@@ -12,11 +13,12 @@
from conans.model.env_info import EnvValues
from conans.model.ref import ConanFileReference
from conans.model.settings import Settings
-from conans.test.utils.test_files import temp_folder
from conans.test.utils.mocks import TestBufferConanOutput
+from conans.test.utils.test_files import temp_folder
@attr('visual_studio')
+@pytest.mark.tool_visual_studio
class VisualStudioMultiGeneratorTest(unittest.TestCase):
@parameterized.expand([(False, ), (True, )])
diff --git a/conans/test/unittests/client/tools/scm/test_git.py b/conans/test/unittests/client/tools/scm/test_git.py
index 87caea41eb2..986fc9190c5 100644
--- a/conans/test/unittests/client/tools/scm/test_git.py
+++ b/conans/test/unittests/client/tools/scm/test_git.py
@@ -1,9 +1,10 @@
# coding=utf-8
import os
-import six
-import unittest
import subprocess
+import unittest
+import pytest
+import six
from mock import patch
from nose.plugins.attrib import attr
from parameterized import parameterized
@@ -11,8 +12,8 @@
from conans.client import tools
from conans.client.tools.scm import Git
from conans.errors import ConanException
-from conans.test.utils.tools import temp_folder, TestClient
from conans.test.utils.scm import create_local_git_repo
+from conans.test.utils.tools import temp_folder, TestClient
from conans.util.files import save
@@ -32,6 +33,7 @@ def test_remove_credentials(self):
@attr('git')
+@pytest.mark.tool_git
class GitToolTest(unittest.TestCase):
@patch('subprocess.Popen')
diff --git a/conans/test/unittests/client/tools/scm/test_svn.py b/conans/test/unittests/client/tools/scm/test_svn.py
index afeb51cb1c6..f0aea1d24da 100644
--- a/conans/test/unittests/client/tools/scm/test_svn.py
+++ b/conans/test/unittests/client/tools/scm/test_svn.py
@@ -2,21 +2,21 @@
import os
import shutil
-import six
import subprocess
import unittest
import uuid
+import pytest
+import six
from mock import patch
-
from nose.plugins.attrib import attr
from six.moves.urllib.parse import quote
from conans.client.tools.scm import SVN
from conans.errors import ConanException
from conans.model.version import Version
-from conans.test.utils.tools import temp_folder, TestClient
from conans.test.utils.scm import SVNLocalRepoTestCase, try_remove_readonly
+from conans.test.utils.tools import temp_folder, TestClient
from conans.util.files import save
@@ -37,6 +37,8 @@ def test_remove_credentials(self):
@attr("slow")
@attr('svn')
+@pytest.mark.slow
+@pytest.mark.tool_svn
class SVNToolTestsBasic(SVNLocalRepoTestCase):
@patch('subprocess.Popen')
@@ -308,6 +310,8 @@ def test_tag(self):
@attr("slow")
@attr('svn')
+@pytest.mark.slow
+@pytest.mark.tool_svn
class SVNToolTestsBasicOldVersion(SVNToolTestsBasic):
def run(self, *args, **kwargs):
try:
@@ -324,6 +328,8 @@ def run(self, *args, **kwargs):
@attr("slow")
@attr('svn')
+@pytest.mark.slow
+@pytest.mark.tool_svn
class SVNToolTestsPristine(SVNLocalRepoTestCase):
def setUp(self):
@@ -426,6 +432,7 @@ def test_missing_remote(self):
@attr("svn")
+@pytest.mark.tool_svn
class SVNToolTestsPristineWithExternalFile(SVNLocalRepoTestCase):
def _propset_cmd(self, relpath, rev, url):
@@ -449,6 +456,7 @@ def test_modified_external(self):
@attr("svn")
+@pytest.mark.tool_svn
class SVNToolTestsPristineWithExternalsNotFixed(SVNLocalRepoTestCase):
def _propset_cmd(self, relpath, url):
@@ -481,6 +489,7 @@ def test_modified_external(self):
@attr("svn")
+@pytest.mark.tool_svn
class SVNToolTestsPristineWithExternalsFixed(SVNLocalRepoTestCase):
def _propset_cmd(self, relpath, rev, url):
@@ -548,6 +557,8 @@ def test_ignored_external(self):
@attr("slow")
@attr('svn')
+@pytest.mark.slow
+@pytest.mark.tool_svn
class SVNToolsTestsRecipe(SVNLocalRepoTestCase):
conanfile = """
diff --git a/conans/test/unittests/client/tools/win/vcvars_arch_test.py b/conans/test/unittests/client/tools/win/vcvars_arch_test.py
index ae3c69fdc02..95b86bfd615 100644
--- a/conans/test/unittests/client/tools/win/vcvars_arch_test.py
+++ b/conans/test/unittests/client/tools/win/vcvars_arch_test.py
@@ -4,6 +4,7 @@
import platform
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.client import tools
@@ -15,6 +16,7 @@
@attr('visual_studio')
+@pytest.mark.tool_visual_studio
@unittest.skipUnless(platform.system() == "Windows", "Requires Windows")
class VCVarsArchTest(unittest.TestCase):
output = TestBufferConanOutput()
diff --git a/conans/test/unittests/client/tools/win/vcvars_clangcl_test.py b/conans/test/unittests/client/tools/win/vcvars_clangcl_test.py
index 042412f5dc6..63f2748df2e 100644
--- a/conans/test/unittests/client/tools/win/vcvars_clangcl_test.py
+++ b/conans/test/unittests/client/tools/win/vcvars_clangcl_test.py
@@ -4,6 +4,7 @@
import platform
import unittest
+import pytest
from mock import mock
from nose.plugins.attrib import attr
@@ -15,6 +16,7 @@
@attr('visual_studio')
+@pytest.mark.tool_visual_studio
@unittest.skipUnless(platform.system() == "Windows", "Requires Windows")
class VCVarsClangClTest(unittest.TestCase):
output = TestBufferConanOutput()
diff --git a/conans/test/unittests/client/tools/win/vcvars_store_test.py b/conans/test/unittests/client/tools/win/vcvars_store_test.py
index e82d1d7f209..d9f4657c7f3 100644
--- a/conans/test/unittests/client/tools/win/vcvars_store_test.py
+++ b/conans/test/unittests/client/tools/win/vcvars_store_test.py
@@ -4,6 +4,7 @@
import platform
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.client import tools
@@ -14,6 +15,7 @@
@attr('visual_studio')
+@pytest.mark.tool_visual_studio
@unittest.skipUnless(platform.system() == "Windows", "Requires Windows")
class VCVarsStoreTest(unittest.TestCase):
output = TestBufferConanOutput()
diff --git a/conans/test/unittests/util/build_sln_command_test.py b/conans/test/unittests/util/build_sln_command_test.py
index 3952e38f0e1..db492fb1ded 100644
--- a/conans/test/unittests/util/build_sln_command_test.py
+++ b/conans/test/unittests/util/build_sln_command_test.py
@@ -5,6 +5,7 @@
import unittest
import warnings
+import pytest
from nose.plugins.attrib import attr
from six import StringIO
@@ -20,6 +21,7 @@
@attr('visual_studio')
+@pytest.mark.tool_visual_studio
class BuildSLNCommandTest(unittest.TestCase):
def test_no_configuration(self):
diff --git a/conans/test/unittests/util/msvs_toolset_test.py b/conans/test/unittests/util/msvs_toolset_test.py
index 08e56b9a76e..9ecd2343d2b 100644
--- a/conans/test/unittests/util/msvs_toolset_test.py
+++ b/conans/test/unittests/util/msvs_toolset_test.py
@@ -4,6 +4,7 @@
import platform
import unittest
+import pytest
from nose.plugins.attrib import attr
from parameterized import parameterized
@@ -12,6 +13,7 @@
@attr('visual_studio')
+@pytest.mark.tool_visual_studio
@unittest.skipUnless(platform.system() == "Windows", "Requires Windows")
class MSVCToolsetTest(unittest.TestCase):
diff --git a/conans/test/unittests/util/pkg_config_test.py b/conans/test/unittests/util/pkg_config_test.py
index 274f9cdddb9..421a857f49f 100644
--- a/conans/test/unittests/util/pkg_config_test.py
+++ b/conans/test/unittests/util/pkg_config_test.py
@@ -5,6 +5,7 @@
import platform
import unittest
+import pytest
from nose.plugins.attrib import attr
from conans.client.tools.env import environment_append
@@ -29,6 +30,7 @@
@attr("unix")
+@pytest.mark.tool_unix
class PkgConfigTest(unittest.TestCase):
def test_negative(self):
if platform.system() == "Windows":
diff --git a/conans/test/unittests/util/tools_test.py b/conans/test/unittests/util/tools_test.py
index e5941607c6c..4dfa103b2c8 100644
--- a/conans/test/unittests/util/tools_test.py
+++ b/conans/test/unittests/util/tools_test.py
@@ -7,6 +7,7 @@
import warnings
from collections import namedtuple
+import pytest
import requests
import six
from bottle import request, static_file, HTTPError
@@ -484,6 +485,7 @@ def test_download_retries_errors(self):
retry=2, retry_wait=0)
@attr("slow")
+ @pytest.mark.slow
def test_download_retries(self):
http_server = StoppableThreadBottle()
@@ -548,6 +550,7 @@ def get_manual_auth(user, password):
http_server.stop()
@attr("slow")
+ @pytest.mark.slow
@patch("conans.tools._global_config")
def test_download_unathorized(self, mock_config):
http_server = StoppableThreadBottle()
@@ -638,7 +641,9 @@ def test_detect_windows_subsystem(self):
self.assertEqual(str, type(result))
@attr('slow')
+ @pytest.mark.slow
@attr('local_bottle')
+ @pytest.mark.tool_local_bottle
def test_get_filename_download(self):
# Create a tar file to be downloaded from server
with tools.chdir(tools.mkdir_tmp()):
@@ -704,7 +709,9 @@ def error_url():
self.assertEqual(str(out).count("Waiting 0 seconds to retry..."), 2)
@attr('slow')
+ @pytest.mark.slow
@attr('local_bottle')
+ @pytest.mark.tool_local_bottle
def test_get_gunzip(self):
# Create a tar file to be downloaded from server
tmp = temp_folder()
diff --git a/tox.ini b/tox.ini
index fbd0b7fb5b1..460b296ff51 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,9 +1,13 @@
[tox]
[testenv]
+setenv =
+ PYTHONPATH = {toxinidir} # Needed to avoid errors with test modules importing other test modules
deps = -rconans/requirements_dev.txt
-commands = nosetests -A "not slow and not svn" [] # substitute with tox' positional arguments
+commands = pytest -m "not slow and not tool_svn" [] # substitute with tox' positional arguments
[testenv:full]
+setenv =
+ PYTHONPATH = {toxinidir} # Needed to avoid errors with test modules importing other test modules
deps = {[testenv]deps}
-commands = nosetests [] # substitute with tox' positional arguments
+commands = pytest [] # substitute with tox' positional arguments