patch OSInfo.bash_path function call
@@ -827,6 +827,7 @@ ProgramFiles(x86)=C:\Program Files (x86)
self._runner = MyRun()
conanfile = MockConanfile()
+ with patch.object(OSInfo, "bash_path", return_value='bash'):
tools.run_in_windows_bash(conanfile, "a_command.bat", subsystem="cygwin")
self.assertIn("bash", conanfile._runner.command)
self.assertIn("--login -c", conanfile._runner.command)
@@ -842,8 +843,9 @@ ProgramFiles(x86)=C:\Program Files (x86)
# try to append more env vars
conanfile = MockConanfile()
- tools.run_in_windows_bash(conanfile, "a_command.bat", subsystem="cygwin", env={"PATH": "/other/path",
- "MYVAR": "34"})
+ with patch.object(OSInfo, "bash_path", return_value='bash'):
+ tools.run_in_windows_bash(conanfile, "a_command.bat", subsystem="cygwin",
+ env={"PATH": "/other/path", "MYVAR": "34"})
self.assertIn('^&^& PATH=\\^"/cygdrive/other/path:/cygdrive/path/to/somewhere:$PATH\\^" '
'^&^& MYVAR=34 ^&^& a_command.bat ^', conanfile._runner.command)
