-
Notifications
You must be signed in to change notification settings - Fork 121
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
test: faking-v150 #3509
base: main
Are you sure you want to change the base?
test: faking-v150 #3509
Conversation
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
@pyansys-ci-bot LGTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Maxime Rey <[email protected]>
Problems with pyfakefs:
Details:tests/test_launcher.py::test_find_ansys_linux[/ansys_inc/v221/ansys/bin/ansys221-22.1-None] Exception in thread Thread-4101:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/threading.py", line 1401, in run
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pytest_memprof.py", line 47, in report_mem
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pytest_memprof.py", line 39, in <lambda>
Exception in thread Thread-4104:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/threading.py", line 1401, in run
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pytest_memprof.py", line 47, in report_mem
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pytest_memprof.py", line 39, in <lambda>
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/psutil/__init__.py", line 2029, in virtual_memory
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/psutil/_pslinux.py", line 428, in virtual_memory
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/psutil/_common.py", line 799, in open_binary
Exception in thread Thread-4105:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/psutil/__init__.py", line 2029, in virtual_memory
Exception in thread Thread-4103:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/threading.py", line 1401, in run
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/psutil/_pslinux.py", line 428, in virtual_memory
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_io.py", line 93, in open
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pytest_memprof.py", line 47, in report_mem
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/psutil/_common.py", line 799, in open_binary
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_open.py", line 105, in fake_open
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pytest_memprof.py", line 39, in <lambda>
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_io.py", line 93, in open
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_open.py", line 105, in fake_open
return self.call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_open.py", line 244, in call
return fake_file_open(
file_object = self._init_file_object(
^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_open.py", line 136, in __call__
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_open.py", line 340, in _init_file_object
self.filesystem.raise_os_error(errno.ENOENT, file_path)
return self.call(*args, **kwargs)
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_filesystem.py", line 489, in raise_os_error
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_open.py", line 244, in call
raise OSError(err_no, message, filename)
FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: '/proc/meminfo'
file_object = self._init_file_object(
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_open.py", line 340, in _init_file_object
self.filesystem.raise_os_error(errno.ENOENT, file_path)
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_filesystem.py", line 489, in raise_os_error
raise OSError(err_no, message, filename)
FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: '/proc/meminfo' |
Co-authored-by: Maxime Rey <[email protected]>
…ymapdl into tests/faking-v150
I have tried to add the real directory... and nothing... it seems we do really depend on the system.... I might need.......... ==================================== ERRORS ====================================
_ ERROR at setup of test_find_ansys_linux[/ansys_inc/v221/ansys/bin/ansys221-22.1-None] _
fs = <pyfakefs.fake_filesystem.FakeFilesystem object at 0x7fa980541d10>
@pytest.fixture
def my_fs(fs):
> fs.add_real_directory("/proc", lazy_read=False)
/__w/pymapdl/pymapdl/tests/test_launcher.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/__t/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_filesystem.py:2417: in add_real_directory
self._create_fake_from_real_dir(source_path_str, target_path_str, read_only)
/__t/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_filesystem.py:2431: in _create_fake_from_real_dir
self.add_real_symlink(file_path, os.path.join(new_base, file_entry))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pyfakefs.fake_filesystem.FakeFilesystem object at 0x7fa980541d10>
source_path = '/proc/644/cwd', target_path = '/proc/644/cwd'
def add_real_symlink(
self, source_path: AnyPath, target_path: Optional[AnyPath] = None
) -> FakeFile:
"""Create a symlink at `source_path` (or `target_path`, if given) and return
the created :py:class:`FakeFile<pyfakefs.fake_file.FakeFile>` object.
It will point to the same path as the symlink on the real filesystem.
Relative symlinks will point relative to their new location. Absolute symlinks
will point to the same, absolute path as on the real filesystem.
Args:
source_path: The path to the existing symlink.
target_path: If given, the name of the symlink in the fake
filesystem, otherwise, the same as `source_path`.
Returns:
the newly created :py:class:`FakeFile<pyfakefs.fake_file.FakeFile>` object.
Raises:
OSError: if the directory does not exist in the real file system.
OSError: if the symlink could not be created
(see :py:meth:`create_file`).
OSError: if the directory already exists in the fake file system.
"""
source_path_str = make_string_path(source_path) # TODO: add test
source_path_str = self._path_without_trailing_separators(source_path_str)
if not os.path.exists(source_path_str) and not os.path.islink(source_path_str):
self.raise_os_error(errno.ENOENT, source_path_str)
> target = os.readlink(source_path_str)
E FileNotFoundError: [Errno 2] No such file or directory: '/proc/644/cwd'
/__t/Python/3.11.10/x64/lib/python3.11/site-packages/pyfakefs/fake_filesystem.py:2352: FileNotFoundError
_ ERROR at setup of test_find_ansys_linux[/ansys_inc/v222/ansys/bin/mapdl-22.2-None] _
fs = <pyfakefs.fake_filesystem.FakeFilesystem object at 0x7fa980cefe50> |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3509 +/- ##
==========================================
+ Coverage 86.94% 87.04% +0.09%
==========================================
Files 187 187
Lines 14622 14623 +1
==========================================
+ Hits 12713 12728 +15
+ Misses 1909 1895 -14 |
Description
Some test refactoring
Issue linked
NA
Checklist
draft
if it is not ready to be reviewed yet.feat: adding new MAPDL command
)