@@ -332,6 +332,23 @@ class Zlib(ConanFile):
332
332
c .run ("install --requires=zlib/[*] --build missing" , assert_error = True )
333
333
assert "NameError: name 'ConanFile' is not defined" in c .out
334
334
335
+ def test_require_revision (self ):
336
+ # https://github.com/conan-io/conan/issues/17814
337
+ folder = temp_folder ()
338
+ recipes_folder = os .path .join (folder , "recipes" )
339
+ zlib_config = textwrap .dedent ("""
340
+ versions:
341
+ "1.2.11":
342
+ folder: all
343
+ """ )
344
+ save_files (recipes_folder ,
345
+ {"zlib/config.yml" : zlib_config ,
346
+ "zlib/all/conanfile.py" : str (GenConanfile ("zlib" ))})
347
+ c = TestClient (light = True )
348
+ c .run (f"remote add local '{ folder } '" )
349
+ c .run ("install --requires=zlib/1.2.11#rev1" , assert_error = True )
350
+ assert "A specific revision 'zlib/1.2.11#rev1' was requested" in c .out
351
+
335
352
336
353
class TestPythonRequires :
337
354
@pytest .fixture (scope = "class" )
@@ -361,6 +378,7 @@ def test_install(self, c3i_pyrequires_folder):
361
378
assert "pyreq/1.0#a0d63ca853edefa33582a24a1bb3c75f - Downloaded (local)" in c .out
362
379
assert "pkg/1.0: Created package" in c .out
363
380
381
+
364
382
class TestUserChannel :
365
383
@pytest .fixture (scope = "class" )
366
384
def c3i_user_channel_folder (self ):
@@ -373,8 +391,8 @@ def c3i_user_channel_folder(self):
373
391
"2.0":
374
392
folder: other
375
393
""" )
376
- pkg = str (GenConanfile ("pkg" ).with_class_attribute ("user='myuser'" )\
377
- .with_class_attribute ("channel='mychannel'" ))
394
+ pkg = str (GenConanfile ("pkg" ).with_class_attribute ("user='myuser'" )
395
+ .with_class_attribute ("channel='mychannel'" ))
378
396
save_files (recipes_folder ,
379
397
{"pkg/config.yml" : config ,
380
398
"pkg/all/conanfile.py" : pkg ,
0 commit comments