Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows tests #2918

Merged
merged 34 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7167507
fix inquire default test
germa89 Mar 19, 2024
6aa8682
fixing the test_detach_examples_submodule
germa89 Mar 19, 2024
39446ec
Fixing test on linux
germa89 Mar 19, 2024
b4df209
Fixing test_get_file_path
germa89 Mar 19, 2024
adf9276
adding gopr
germa89 Mar 19, 2024
bff1c4c
Update tests/conftest.py
germa89 Mar 20, 2024
79e4e24
fixing tbft test
Mar 20, 2024
3141256
fixing launch cli
Mar 20, 2024
e4d808c
Fixing test_launch_mapdl_cli test
germa89 Mar 20, 2024
d0e2299
fixing cli list test on cluster
Mar 20, 2024
76b8d41
fixing licensing tests
Mar 20, 2024
ccd3ea4
making ports depending on the mapdl fixture
Mar 20, 2024
ae1ce22
fixing missing licensing tests
germa89 Mar 20, 2024
bf10d17
Merge branch 'fix/windows-tests' of https://github.com/ansys/pymapdl …
germa89 Mar 20, 2024
4466200
Avoinding raising exception about exec_file
germa89 Mar 20, 2024
0f64af9
Fixing test_cache_pids
germa89 Mar 20, 2024
7251bcc
Fix test_file_command_local
germa89 Mar 20, 2024
6737405
Fix test_inquire
germa89 Mar 20, 2024
68d9961
fixing recovering MAPDL instance between tests
germa89 Mar 20, 2024
336d313
Merge branch 'main' into fix/windows-tests
germa89 Mar 20, 2024
b890323
Merge branch 'main' into fix/windows-tests
germa89 Mar 21, 2024
1e4e31c
attemp to fix reconnect to MAPDL.
germa89 Mar 21, 2024
18682db
fixing cli test
Mar 21, 2024
29e1a28
fixing not raising wanring
Mar 21, 2024
c666df8
fix test readin
Mar 21, 2024
b9de139
trying catching the warn
Mar 21, 2024
0943195
Merge branch 'main' into fix/windows-tests
germa89 Mar 21, 2024
6d18700
Reseting full mapdl object
germa89 Mar 21, 2024
576c574
avoiding test
germa89 Mar 21, 2024
b03a4b4
improving test reliability
germa89 Mar 21, 2024
50fbc5b
skipping check on v241
Mar 21, 2024
543abaf
return empty string if on debug
Mar 21, 2024
d528bd8
Rising the raise exception
Mar 21, 2024
7941b77
Fixing error type
Mar 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ def run_before_and_after_tests_2(request, mapdl):

yield

mapdl.run("/GOPR")
germa89 marked this conversation as resolved.
Show resolved Hide resolved
assert prev == mapdl.is_local


Expand Down
29 changes: 17 additions & 12 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,28 +164,33 @@ def test_download_tech_demo_data(running_test):

@requires("requests")
def test_detach_examples_submodule():
cmd = """
cmd = (
"""
import sys

assert "ansys.mapdl.core" not in sys.modules
assert "requests" not in sys.modules
assert "ansys.mapdl.core.examples" not in sys.modules
assert 'ansys.mapdl.core' not in sys.modules
assert 'requests' not in sys.modules
assert 'ansys.mapdl.core.examples' not in sys.modules

from ansys.mapdl import core as pymapdl

assert "ansys.mapdl.core" in sys.modules
assert "ansys.mapdl.core.examples" not in sys.modules
assert "requests" not in sys.modules
assert 'ansys.mapdl.core' in sys.modules
assert 'ansys.mapdl.core.examples' not in sys.modules
assert 'requests' not in sys.modules

from ansys.mapdl.core.examples import vmfiles

assert "ansys.mapdl.core.examples" in sys.modules
assert "requests" in sys.modules
assert 'ansys.mapdl.core.examples' in sys.modules
assert 'requests' in sys.modules

print("Everything went well")
"""
print('Everything went well')
""".strip()
.replace("\n", ";")
.replace(";;", ";")
)

cmd_line = f"""python -c "{cmd}" """

cmd_line = f"""python -c '{cmd}' """
p = Popen(cmd_line, shell=True, stdout=PIPE, stderr=STDOUT)
out = p.communicate()[0].decode()

Expand Down
5 changes: 4 additions & 1 deletion tests/test_mapdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,7 @@ def test_get_file_path(mapdl, tmpdir):
assert fobject not in mapdl.list_files()
assert fobject not in os.listdir()

prev = mapdl._local
mapdl._local = True
fname_ = mapdl._get_file_path(fobject)
assert fname in fname_
Expand All @@ -1277,6 +1278,8 @@ def test_get_file_path(mapdl, tmpdir):
# If we are not in local, now it should have been uploaded
assert fname in mapdl.list_files()

mapdl._local = prev


@pytest.mark.parametrize(
"option2,option3,option4",
Expand Down Expand Up @@ -2244,7 +2247,7 @@ def test_inquire_invalid(mapdl):

def test_inquire_default(mapdl):
mapdl.title = "heeeelloo"
assert mapdl.directory == mapdl.inquire()
assert Path(mapdl.directory) == Path(mapdl.inquire())


def test_vwrite_error(mapdl):
Expand Down
Loading