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 test in non-editable installation #24

Open
ericpre opened this issue Jan 3, 2025 · 0 comments
Open

Fix test in non-editable installation #24

ericpre opened this issue Jan 3, 2025 · 0 comments

Comments

@ericpre
Copy link

ericpre commented Jan 3, 2025

In non-editable installation pytest --pyargs etspy fails with the following error:

From https://github.com/hyperspy/hyperspy-extensions-list/actions/runs/12589744036/job/35090082169

============================= test session starts ==============================
platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
Matplotlib: 3.10.0
Freetype: 2.[12](https://github.com/hyperspy/hyperspy-extensions-list/actions/runs/12589744036/job/35090082169#step:29:13).1
rootdir: /home/runner/work/hyperspy-extensions-list/hyperspy-extensions-list
plugins: mpl-0.17.0, rerunfailures-15.0, xdist-3.6.1
created: 2/2 workers
2 workers [263 items]

...............ss....................................................... [ 27%]
........................................................................ [ 54%]
....ssss.................................................s.............. [ 82%]
...................................ssssssss...F                          [100%]
=================================== FAILURES ===================================
_________________________________ test_version _________________________________
[gw1] linux -- Python 3.12.8 /home/runner/miniconda3/envs/test/bin/python

    def test_version():
        """Test version definition."""
        pyproject = etspy_path.parent / "pyproject.toml"
>       with pyproject.open("rb") as f:

/home/runner/miniconda3/envs/test/lib/python3.12/site-packages/etspy/tests/test_version.py:[13](https://github.com/hyperspy/hyperspy-extensions-list/actions/runs/12589744036/job/35090082169#step:29:14): 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/home/runner/miniconda3/envs/test/lib/python3.12/site-packages/pyproject.toml')
mode = 'rb', buffering = -1, encoding = None, errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed to by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return io.open(self, mode, buffering, encoding, errors, newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/miniconda3/envs/test/lib/python3.12/site-packages/pyproject.toml'

/home/runner/miniconda3/envs/test/lib/python3.12/pathlib.py:1013: FileNotFoundError
=============================== warnings summary ===============================
../../../miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:258
../../../miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:258
  /home/runner/miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:258: DeprecationWarning: module 'sre_parse' is deprecated
    import sre_parse

../../../miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:259
../../../miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:259
  /home/runner/miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:259: DeprecationWarning: module 'sre_constants' is deprecated
    import sre_constants

tests/test_utils.py::TestMultiframeAverage::test_register_serialem_stack_multicpu
tests/test_utils.py::TestMultiframeAverage::test_register_serialem_stack_multicpu
  /home/runner/miniconda3/envs/test/lib/python3.12/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=5044) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_version.py::test_version - FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/miniconda3/envs/test/lib/python3.12/site-packages/pyproject.toml'
======= 1 failed, 247 passed, [15](https://github.com/hyperspy/hyperspy-extensions-list/actions/runs/12589744036/job/35090082169#step:29:16) skipped, 6 warnings in 63.61s (0:01:03) =======
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant