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

Typeguard error #37

Open
rickybassom opened this issue Feb 13, 2022 · 0 comments
Open

Typeguard error #37

rickybassom opened this issue Feb 13, 2022 · 0 comments
Labels
ci Continuous Integration python Pull requests that update Python code testing Testing

Comments

@rickybassom
Copy link
Owner

Issue raised by: [developer]

What?

Typeguard is current disabled because of errors that appear near to impossible to fix.

#36

self = <tests.test_gmn_trajectory_summary_reader.TestGmnTrajectorySummaryReader testMethod=test_read_trajectory_summary_file_as_numpy_array>

    @typeguard_ignore
    def test_read_trajectory_summary_file_as_numpy_array(self) -> None:
        """
        Test: That the trajectory summary file can be read as a numpy array by checking
        properties.
        When: read_trajectory_summary_file_as_numpy_array is called.
        """
        self._test_read_trajectory_summary_using_numpy_array(
>           gtsr.read_trajectory_summary_as_numpy_array(self.test_file_path)
        )

tests/test_gmn_trajectory_summary_reader.py:68: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.nox/typeguard-3-10/lib/python3.10/site-packages/typeguard/__init__.py:1031: in wrapper
    memo = _CallMemo(python_func, _localns, args=args, kwargs=kwargs)
.nox/typeguard-3-10/lib/python3.10/site-packages/typeguard/__init__.py:210: in __init__
    hints = get_type_hints(func, localns=frame_locals)
/usr/lib64/python3.10/typing.py:1849: in get_type_hints
    value = _eval_type(value, globalns, localns)
/usr/lib64/python3.10/typing.py:328: in _eval_type
    ev_args = tuple(_eval_type(a, globalns, localns, recursive_guard) for a in t.__args__)
/usr/lib64/python3.10/typing.py:328: in <genexpr>
    ev_args = tuple(_eval_type(a, globalns, localns, recursive_guard) for a in t.__args__)
/usr/lib64/python3.10/typing.py:326: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib64/python3.10/typing.py:691: in _evaluate
    eval(self.__forward_code__, globalns, localns),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'PathLike' is not defined

<string>:1: NameError
=========================================================================================================== warnings summary ===========================================================================================================
.nox/typeguard-3-10/lib/python3.10/site-packages/typeguard/__init__.py:1027
  /home/rickybassom/Projects/gmn-data-platform/gmn-python-api/.nox/typeguard-3-10/lib/python3.10/site-packages/typeguard/__init__.py:1027: UserWarning: no code associated -- not typechecking click.core.<Command main>
    warn('no code associated -- not typechecking {}'.format(function_name(func)))

-- Docs: https://docs.pytest.org/en/stable/warnings.html
======================================================================================================= short test summary info ========================================================================================================
FAILED tests/test_gmn_trajectory_summary_reader.py::TestGmnTrajectorySummaryReader::test_read_trajectory_summary_buffer_as_data_frame - NameError: name 'PathLike' is not defined
FAILED tests/test_gmn_trajectory_summary_reader.py::TestGmnTrajectorySummaryReader::test_read_trajectory_summary_buffer_as_numpy_array - NameError: name 'PathLike' is not defined
FAILED tests/test_gmn_trajectory_summary_reader.py::TestGmnTrajectorySummaryReader::test_read_trajectory_summary_file_as_data_frame - NameError: name 'PathLike' is not defined
FAILED tests/test_gmn_trajectory_summary_reader.py::TestGmnTrajectorySummaryReader::test_read_trajectory_summary_file_as_numpy_array - NameError: name 'PathLike' is not defined

self = <tests.test_gmn_trajectory_summary_reader.TestGmnTrajectorySummaryReader testMethod=test_read_trajectory_summary_file_as_numpy_array>

    def test_read_trajectory_summary_file_as_numpy_array(self) -> None:
        """
        Test: That the trajectory summary file can be read as a numpy array by checking
        properties.
        When: read_trajectory_summary_file_as_numpy_array is called.
        """
        self._test_read_trajectory_summary_using_numpy_array(
>           gtsr.read_trajectory_summary_as_numpy_array(self.test_file_path)
        )

tests/test_gmn_trajectory_summary_reader.py:68: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.nox/typeguard-3-8/lib/python3.8/site-packages/typeguard/__init__.py:1031: in wrapper
    memo = _CallMemo(python_func, _localns, args=args, kwargs=kwargs)
.nox/typeguard-3-8/lib/python3.8/site-packages/typeguard/__init__.py:210: in __init__
    hints = get_type_hints(func, localns=frame_locals)
/usr/lib64/python3.8/typing.py:1264: in get_type_hints
    value = _eval_type(value, globalns, localns)
/usr/lib64/python3.8/typing.py:272: in _eval_type
    ev_args = tuple(_eval_type(a, globalns, localns) for a in t.__args__)
/usr/lib64/python3.8/typing.py:272: in <genexpr>
    ev_args = tuple(_eval_type(a, globalns, localns) for a in t.__args__)
/usr/lib64/python3.8/typing.py:270: in _eval_type
    return t._evaluate(globalns, localns)
/usr/lib64/python3.8/typing.py:518: in _evaluate
    eval(self.__forward_code__, globalns, localns),

Where?

tests/test_gmn_trajectory_summary_reader.py

How to test the issue is resolved

  • Re-enable typeguard and run nox --session=typeguard
@rickybassom rickybassom added ci Continuous Integration python Pull requests that update Python code testing Testing labels Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration python Pull requests that update Python code testing Testing
Projects
None yet
Development

No branches or pull requests

1 participant