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

Automatic test fails on Python 3.5 #4

Closed
Arkh42 opened this issue May 13, 2020 · 2 comments
Closed

Automatic test fails on Python 3.5 #4

Arkh42 opened this issue May 13, 2020 · 2 comments

Comments

@Arkh42
Copy link
Owner

Arkh42 commented May 13, 2020

Log :

 Run pytest
============================= test session starts ==============================
platform linux -- Python 3.5.9, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
rootdir: /home/runner/work/rtestbench/rtestbench
collected 71 items

rtestbench/tests/test_chat.py ...                                        [  4%]
rtestbench/tests/test_core.py ..........                                 [ 18%]
rtestbench/tests/test_electrometer.py ..........                         [ 32%]
rtestbench/tests/test_factories.py ...........                           [ 47%]
rtestbench/tests/test_keysight_electrometers.py .................        [ 71%]
rtestbench/tests/test_logger.py ..                                       [ 74%]
rtestbench/tests/test_meta.py E.EEEE                                     [ 83%]
rtestbench/tests/test_tool.py ............                               [100%]

==================================== ERRORS ====================================
______________________ ERROR at setup of test_initialize _______________________

tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_initialize0')

    @pytest.fixture
    def meta_man(tmp_path):
        """Returns a MetaDataManager."""
    
        d = tmp_path / "json"
        d.mkdir()
    
        f = d / "meta_file"
>       man = meta.MetaDataManager(f)

rtestbench/tests/test_meta.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
rtestbench/_meta.py:27: in __init__
    self._file_path = Path(file_path)
/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:969: in __new__
    self = cls._from_parts(args, init=False)
/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:651: in _from_parts
    drv, root, parts = self._parse_args(args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'pathlib.PosixPath'>
args = (PosixPath('/tmp/pytest-of-runner/pytest-0/test_initialize0/json/meta_file'),)

    @classmethod
    def _parse_args(cls, args):
        # This is useful when you don't want to create an instance, just
        # canonicalize some constructor arguments.
        parts = []
        for a in args:
            if isinstance(a, PurePath):
                parts += a._parts
            elif isinstance(a, str):
                # Force-cast str subclasses to str (issue #21127)
                parts.append(str(a))
            else:
                raise TypeError(
                    "argument should be a path or str object, not %r"
>                   % type(a))
E               TypeError: argument should be a path or str object, not <class 'pathlib2.PosixPath'>

/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:643: TypeError
_________________ ERROR at setup of test_dump_meta[json_data0] _________________

tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_dump_meta_json_data0_0')

    @pytest.fixture
    def meta_man(tmp_path):
        """Returns a MetaDataManager."""
    
        d = tmp_path / "json"
        d.mkdir()
    
        f = d / "meta_file"
>       man = meta.MetaDataManager(f)

rtestbench/tests/test_meta.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
rtestbench/_meta.py:27: in __init__
    self._file_path = Path(file_path)
/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:969: in __new__
    self = cls._from_parts(args, init=False)
/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:651: in _from_parts
    drv, root, parts = self._parse_args(args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'pathlib.PosixPath'>
args = (PosixPath('/tmp/pytest-of-runner/pytest-0/test_dump_meta_json_data0_0/json/meta_file'),)

    @classmethod
    def _parse_args(cls, args):
        # This is useful when you don't want to create an instance, just
        # canonicalize some constructor arguments.
        parts = []
        for a in args:
            if isinstance(a, PurePath):
                parts += a._parts
            elif isinstance(a, str):
                # Force-cast str subclasses to str (issue #21127)
                parts.append(str(a))
            else:
                raise TypeError(
                    "argument should be a path or str object, not %r"
>                   % type(a))
E               TypeError: argument should be a path or str object, not <class 'pathlib2.PosixPath'>

/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:643: TypeError
_________________ ERROR at setup of test_dump_meta[json_data1] _________________

tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_dump_meta_json_data1_0')

    @pytest.fixture
    def meta_man(tmp_path):
        """Returns a MetaDataManager."""
    
        d = tmp_path / "json"
        d.mkdir()
    
        f = d / "meta_file"
>       man = meta.MetaDataManager(f)

rtestbench/tests/test_meta.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
rtestbench/_meta.py:27: in __init__
    self._file_path = Path(file_path)
/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:969: in __new__
    self = cls._from_parts(args, init=False)
/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:651: in _from_parts
    drv, root, parts = self._parse_args(args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'pathlib.PosixPath'>
args = (PosixPath('/tmp/pytest-of-runner/pytest-0/test_dump_meta_json_data1_0/json/meta_file'),)

    @classmethod
    def _parse_args(cls, args):
        # This is useful when you don't want to create an instance, just
        # canonicalize some constructor arguments.
        parts = []
        for a in args:
            if isinstance(a, PurePath):
                parts += a._parts
            elif isinstance(a, str):
                # Force-cast str subclasses to str (issue #21127)
                parts.append(str(a))
            else:
                raise TypeError(
                    "argument should be a path or str object, not %r"
>                   % type(a))
E               TypeError: argument should be a path or str object, not <class 'pathlib2.PosixPath'>

/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:643: TypeError
____________________ ERROR at setup of test_dump_timestamp _____________________

tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_dump_timestamp0')

    @pytest.fixture
    def meta_man(tmp_path):
        """Returns a MetaDataManager."""
    
        d = tmp_path / "json"
        d.mkdir()
    
        f = d / "meta_file"
>       man = meta.MetaDataManager(f)

rtestbench/tests/test_meta.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
rtestbench/_meta.py:27: in __init__
    self._file_path = Path(file_path)
/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:969: in __new__
    self = cls._from_parts(args, init=False)
/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:651: in _from_parts
    drv, root, parts = self._parse_args(args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'pathlib.PosixPath'>
args = (PosixPath('/tmp/pytest-of-runner/pytest-0/test_dump_timestamp0/json/meta_file'),)

    @classmethod
    def _parse_args(cls, args):
        # This is useful when you don't want to create an instance, just
        # canonicalize some constructor arguments.
        parts = []
        for a in args:
            if isinstance(a, PurePath):
                parts += a._parts
            elif isinstance(a, str):
                # Force-cast str subclasses to str (issue #21127)
                parts.append(str(a))
            else:
                raise TypeError(
                    "argument should be a path or str object, not %r"
>                   % type(a))
E               TypeError: argument should be a path or str object, not <class 'pathlib2.PosixPath'>

/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:643: TypeError
_____________________ ERROR at setup of test_dump_run_info _____________________

tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_dump_run_info0')

    @pytest.fixture
    def meta_man(tmp_path):
        """Returns a MetaDataManager."""
    
        d = tmp_path / "json"
        d.mkdir()
    
        f = d / "meta_file"
>       man = meta.MetaDataManager(f)

rtestbench/tests/test_meta.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
rtestbench/_meta.py:27: in __init__
    self._file_path = Path(file_path)
/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:969: in __new__
    self = cls._from_parts(args, init=False)
/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:651: in _from_parts
    drv, root, parts = self._parse_args(args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'pathlib.PosixPath'>
args = (PosixPath('/tmp/pytest-of-runner/pytest-0/test_dump_run_info0/json/meta_file'),)

    @classmethod
    def _parse_args(cls, args):
        # This is useful when you don't want to create an instance, just
        # canonicalize some constructor arguments.
        parts = []
        for a in args:
            if isinstance(a, PurePath):
                parts += a._parts
            elif isinstance(a, str):
                # Force-cast str subclasses to str (issue #21127)
                parts.append(str(a))
            else:
                raise TypeError(
                    "argument should be a path or str object, not %r"
>                   % type(a))
E               TypeError: argument should be a path or str object, not <class 'pathlib2.PosixPath'>

/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/pathlib.py:643: TypeError
=============================== warnings summary ===============================
rtestbench/tests/test_tool.py::ToolTest::test_query_data
  /opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/pyvisa/util.py:210: DeprecationWarning: string or file could not be read to its end due to unmatched data; this will raise a ValueError in the future.
    sep=separator)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
ERROR rtestbench/tests/test_meta.py::test_initialize - TypeError: argument sh...
ERROR rtestbench/tests/test_meta.py::test_dump_meta[json_data0] - TypeError: ...
ERROR rtestbench/tests/test_meta.py::test_dump_meta[json_data1] - TypeError: ...
ERROR rtestbench/tests/test_meta.py::test_dump_timestamp - TypeError: argumen...
ERROR rtestbench/tests/test_meta.py::test_dump_run_info - TypeError: argument...
=================== 66 passed, 1 warning, 5 errors in 2.00s ====================
##[error]Process completed with exit code 1.
@Arkh42
Copy link
Owner Author

Arkh42 commented May 13, 2020

OK now, for Python >= 3.6.

@Arkh42 Arkh42 closed this as completed May 13, 2020
@Arkh42 Arkh42 reopened this May 13, 2020
@Arkh42
Copy link
Owner Author

Arkh42 commented Oct 13, 2020

PyVISA has now been released under v 1.11.1 (October 1, 2020).
It is specified in the requirements to use Python 3.6+ (see https://pypi.org/project/PyVISA/).
So this issue is no longer required and can be closed.

@Arkh42 Arkh42 closed this as completed Oct 13, 2020
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