fix: subs cli test #4816
GitHub Actions / Test Report 3.11
failed
Oct 17, 2024 in 0s
37 tests run, 36 passed, 0 skipped, 1 failed.
Annotations
Check failure on line 424 in tests/test_cli.py
github-actions / Test Report 3.11
test_cli.test_ideconfig_default
TypeError: 'in <string>' requires string as left operand, not int
Raw output
test_env = <conftest.test_env.<locals>.TestEnv object at 0x7f4b83cb7610>
run_subprocess = <function run_subprocess.<locals>.func at 0x7f4b83c9e980>
rootdir = PosixPath('/__w/pymechanical/pymechanical')
pytestconfig = <_pytest.config.Config object at 0x7f4b86112810>
@pytest.mark.cli
@pytest.mark.python_env
def test_ideconfig_default(test_env, run_subprocess, rootdir, pytestconfig):
"""Test the IDE configuration location when no arguments are supplied."""
# Get the revision number
revision = int(pytestconfig.getoption("ansys_version"))
# Set part of the settings.json path
settings_json_fragment = Path("Code") / "User" / "settings.json"
# Install pymechanical
subprocess.check_call(
[test_env.python, "-m", "pip", "install", "-e", "."],
cwd=rootdir,
env=test_env.env,
)
# Run ansys-mechanical-ideconfig in the test virtual environment
process, stdout, stderr = run_subprocess(
[
"ansys-mechanical-ideconfig",
],
env=test_env.env,
)
# Decode stdout and fix extra backslashes in paths
stdout = stdout.decode().replace("\\\\", "\\")
if revision < 241 or revision > 242:
assert f"PyMechanical Stubs are not available for {revision}." in stdout
else:
> assert revision in stdout
E TypeError: 'in <string>' requires string as left operand, not int
tests/test_cli.py:424: TypeError
Loading