Skip to content

Commit 83829ed

Browse files
committed
new cleanings
1 parent 42fa33d commit 83829ed

File tree

10 files changed

+15
-68
lines changed

10 files changed

+15
-68
lines changed

test/functional/toolchains/autotools/__init__.py

Whitespace-only changes.

test/functional/toolchains/cmake/cmakedeps/test_apple_frameworks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def build(self):
4242

4343

4444
# needs at least 3.23.3 because of error with "empty identity"
45-
# https://stackoverflow.com/questions/72746725/xcode-14-beta-cmake-not-able-to-resolve-cmake-c-compiler-and-cmake-cxx-compiler
45+
# https://stackoverflow.com/questions/72746725/xcode-14-beta-cmake-not-able-to-resolve-cmake-c-compiler-and-cmake-cxx-compiler
4646
@pytest.mark.skipif(platform.system() != "Darwin", reason="Only OSX")
4747
@pytest.mark.tool("cmake", "3.23")
4848
def test_apple_framework_xcode(client):

test/functional/toolchains/cmake/cmakedeps/test_cmakedeps_components_names.py

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import platform
32
import shutil
43
import textwrap
54

@@ -280,27 +279,6 @@ def test_standard_names(setup_client_with_greetings):
280279

281280
create_chat(client, "standard", package_info, cmake_find, test_cmake_find)
282281

283-
# Test consumer multi-config
284-
if platform.system() == "Windows":
285-
with client.chdir("test_package"):
286-
# FIXME This doesn't work because test_package requires has been disabled
287-
return
288-
client.run("install . -s build_type=Release")
289-
client.run("install . -s build_type=Debug")
290-
client.run_command('cmake . -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake')
291-
client.run_command("cmake --build . --config Debug")
292-
client.run_command(r".\Debug\example.exe")
293-
assert "sayhellobye: Debug!" in client.out
294-
assert "sayhello: Debug!" in client.out
295-
assert "hello: Debug!" in client.out
296-
assert "bye: Debug!" in client.out
297-
client.run_command("cmake --build . --config Release")
298-
client.run_command(r".\Release\example.exe")
299-
assert "sayhellobye: Release!" in client.out
300-
assert "sayhello: Release!" in client.out
301-
assert "hello: Release!" in client.out
302-
assert "bye: Release!" in client.out
303-
304282

305283
@pytest.mark.tool("cmake")
306284
def test_custom_names(setup_client_with_greetings):
@@ -582,32 +560,6 @@ def requirements(self):
582560
settings = "build_type"
583561
""")
584562

585-
def test_component_not_found(self):
586-
conanfile = textwrap.dedent("""
587-
from conan import ConanFile
588-
class GreetingsConan(ConanFile):
589-
def package_info(self):
590-
self.cpp_info.components["hello"].libs = ["hello"]
591-
self.cpp_info.components["hello"].libdirs = ["lib"]
592-
self.cpp_info.components["hello"].includedirs = ["include"]
593-
""")
594-
client = TestClient()
595-
client.save({"conanfile.py": conanfile})
596-
client.run("create . --name=greetings --version=0.0.1")
597-
598-
conanfile = textwrap.dedent("""
599-
from conan import ConanFile
600-
class WorldConan(ConanFile):
601-
requires = "greetings/0.0.1"
602-
def package_info(self):
603-
self.cpp_info.components["helloworld"].requires = ["greetings::non-existent"]
604-
""")
605-
client.save({"conanfile.py": conanfile})
606-
client.run("create . --name=world --version=0.0.1")
607-
client.run("install --requires=world/0.0.1@ -g CMakeDeps", assert_error=True)
608-
assert ("Component 'greetings::non-existent' not found in 'greetings' "
609-
"package requirement" in client.out)
610-
611563
client = TestClient()
612564
client.save({"zlib.py": zlib, "mypkg.py": mypkg, "final.py": final, "consumer.py": consumer})
613565
client.run("create zlib.py")
@@ -820,7 +772,7 @@ def build(self):
820772
""")
821773
if check_components_exist is False:
822774
conanfile = conanfile.format("deps.check_components_exist=False")
823-
elif check_components_exist is True:
775+
elif check_components_exist:
824776
conanfile = conanfile.format("deps.check_components_exist=True")
825777
else:
826778
conanfile = conanfile.format("")

test/functional/toolchains/cmake/cmakedeps/test_cmakedeps_find_module_and_config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ def test_reuse_with_modules_and_config(client):
132132

133133

134134
@pytest.mark.tool("cmake")
135-
@pytest.mark.parametrize("find_mode_PKGA, find_mode_PKGB, find_mode_consumer", find_modes)
136-
def test_transitive_modules_found(find_mode_PKGA, find_mode_PKGB, find_mode_consumer):
135+
@pytest.mark.parametrize("find_mode_pkga, find_mode_pkgb, find_mode_consumer", find_modes)
136+
def test_transitive_modules_found(find_mode_pkga, find_mode_pkgb, find_mode_consumer):
137137
"""
138138
related to https://github.com/conan-io/conan/issues/10224
139139
modules files variables were set with the pkg_name_FOUND or pkg_name_VERSION
@@ -187,8 +187,8 @@ def build(self):
187187
""")
188188

189189
client.save({"pkgb.py": conan_pkg.format(requires='requires="pkga/1.0"', filename='MYPKGB', module_filename='MYPKGB',
190-
mode=find_mode_PKGB),
191-
"pkga.py": conan_pkg.format(requires='', filename='MYPKGA', module_filename='unicorns', mode=find_mode_PKGA),
190+
mode=find_mode_pkgb),
191+
"pkga.py": conan_pkg.format(requires='', filename='MYPKGA', module_filename='unicorns', mode=find_mode_pkga),
192192
"consumer.py": consumer,
193193
"CMakeLists.txt": cmakelist.format(find_mode=find_mode_consumer)})
194194

@@ -210,6 +210,6 @@ def build(self):
210210
assert "MYPKGB_DEFINITIONS: -DDEFINE_MYPKGB" in client.out
211211
assert "Conan: Target declared 'pkga::pkga'"
212212

213-
if find_mode_PKGA == "module":
213+
if find_mode_pkga == "module":
214214
assert 'Found unicorns: 1.0 (found version "1.0")' in client.out
215215

test/functional/toolchains/cmake/cmakedeps2/test_cmakeconfigdeps_new.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,6 @@ def package_info(self):
15291529
assert "dep/0.1 cpp_info incorrect .type shared-library for .exe myexe" in c.out
15301530

15311531

1532-
15331532
def test_multiple_find_package_subfolder():
15341533
c = TestClient()
15351534
conanfile = textwrap.dedent("""

test/functional/toolchains/cmake/test_cmake_and_no_soname_flag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_no_soname_flag(nosoname_property):
6363

6464
# If `nosoname_property` is False, and we have a library without the SONAME flag,
6565
# then it should fail
66-
if nosoname_property is False:
66+
if not nosoname_property:
6767
client.run_command(command, assert_error=True)
6868
assert "libnosoname.so: cannot open shared object file: " \
6969
"No such file or directory" in client.out

test/functional/toolchains/cmake/test_cmake_extra_variables.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import textwrap
22
import pytest
33

4-
from conan.test.assets.genconanfile import GenConanfile
54
from conan.test.utils.tools import TestClient
65
new_value = "will_break_next"
76

@@ -34,7 +33,6 @@ def package_info(self):
3433
message(STATUS "FOO=${FOO}")
3534
""")
3635

37-
3836
conanfile = textwrap.dedent(f"""
3937
from conan import ConanFile
4038
from conan.tools.cmake import CMake
@@ -54,4 +52,3 @@ def build(self):
5452
"""-c tools.cmake.cmaketoolchain:extra_variables="{'FOO': '9'}" """)
5553

5654
assert "-- FOO=9" in client.out
57-

test/functional/toolchains/cmake/test_cmake_toolchain.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -760,11 +760,11 @@ def package(self):
760760
""")
761761

762762
client.save({"conanfile.py": conanfile,
763-
"libfoo.so": "",
764-
"foobin": "",
765-
"host_profile": host_profile,
766-
"build_profile": build_profile
767-
})
763+
"libfoo.so": "",
764+
"foobin": "",
765+
"host_profile": host_profile,
766+
"build_profile": build_profile
767+
})
768768

769769
client.run("create . -pr:b build_profile -pr:h build_profile")
770770
build_context_package_folder = re.search(r"Package folder ([\w\W]+).conan2([\w\W]+)", str(client.out)).group(2).strip()
@@ -1345,7 +1345,7 @@ def build(self):
13451345

13461346
c.save({"android": android,
13471347
"conanfile.py": conanfile,
1348-
"CMakeLists.txt": cmake,})
1348+
"CMakeLists.txt": cmake})
13491349
# first run works ok
13501350
c.run('build . --profile:host=android')
13511351
assert 'sdk: 1.0.0' in c.out

test/functional/toolchains/cmake/test_ninja.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ def package(self):
5858
@pytest.mark.parametrize("build_type,shared", [("Release", False), ("Debug", True)])
5959
@pytest.mark.tool("ninja")
6060
def test_locally_build_linux(build_type, shared, client):
61-
settings = "-s os=Linux -s arch=x86_64 -s build_type={} -o hello/*:shared={}".format(build_type,
62-
shared)
61+
settings = f"-s os=Linux -s arch=x86_64 -s build_type={build_type} -o hello/*:shared={shared}"
6362
client.run("install . {}".format(settings))
6463
client.run_command('cmake . -G "Ninja" -DCMAKE_TOOLCHAIN_FILE={} -DCMAKE_BUILD_TYPE={}'
6564
.format(CMakeToolchain.filename, build_type))

test/functional/toolchains/emscripten/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)