Skip to content

Data Structures and Searching UnitTests Failing #38

@IanDoarn

Description

@IanDoarn

test_data_structures and test_searching.py are failing their UnitTests

test_data_structures

Error
Traceback (most recent call last):
  File "C:\Users\doarni\AppData\Local\Continuum\Anaconda3\lib\unittest\case.py", line 58, in testPartExecutor
    yield
  File "C:\Users\doarni\AppData\Local\Continuum\Anaconda3\lib\unittest\case.py", line 600, in run
    testMethod()
  File "C:\Users\doarni\Dev\pygorithm\tests\test_data_structure.py", line 39, in test_infix_to_postfix
    resultString = result.infix_to_postfix()
  File "C:\Users\doarni\Dev\pygorithm\pygorithm\data_structures\stack.py", line 131, in infix_to_postfix
    and self.__precedence(self.expression[i] <= self.__precedence(self.my_stack.peek())):
TypeError: unorderable types: str() <= int()

.....
======================================================================
ERROR: test_infix_to_postfix (tests.test_data_structure.TestInfixToPostfix)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\doarni\Dev\pygorithm\tests\test_data_structure.py", line 39, in test_infix_to_postfix
    resultString = result.infix_to_postfix()
  File "C:\Users\doarni\Dev\pygorithm\pygorithm\data_structures\stack.py", line 131, in infix_to_postfix
    and self.__precedence(self.expression[i] <= self.__precedence(self.my_stack.peek())):
TypeError: unorderable types: str() <= int()

----------------------------------------------------------------------
Ran 14 tests in 0.031s

FAILED (errors=1)

test_searching

EE.
======================================================================
ERROR: test_binary_search (tests.test_searching.TestBinarySearch)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\doarni\Dev\pygorithm\tests\test_searching.py", line 40, in test_binary_search
    alpha_result = binary_search.search(self.array, 'n')
  File "C:\Users\doarni\Dev\pygorithm\pygorithm\searching\binary_search.py", line 37, in search
    elif target < _list[mid]:
TypeError: unorderable types: str() < int()

======================================================================
ERROR: test_dfs (tests.test_searching.TestDFSSearch)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\doarni\Dev\pygorithm\tests\test_searching.py", line 72, in test_dfs
    result = depth_first_search.search(self.graph, 'A')
  File "C:\Users\doarni\Dev\pygorithm\pygorithm\searching\depth_first_search.py", line 21, in search
    _path = path + [start]
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'

----------------------------------------------------------------------
Ran 4 tests in 0.016s

FAILED (errors=2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions