Skip to content

unittest plugin does not show results #165

@wanderson42

Description

@wanderson42

Description of your problem

I implemented a simple Conditional Statement:
##################################
def maximo (valor, valor2):
if valor > valor2:
return valor
else:
return valor2

def test_maximo1():
assert maximo(2,4) == 4

def test_maximo2():
assert maximo(-1,-5) == -1

def test_maximo3():
assert maximo(0,-10) == 0

def test_maximo4():
assert maximo(1,100) == 1 # running a propsital wrong test
##################################

Run tests exhibit: "No results to show."

I implemented the same test successfully via linux terminal:

(base) wander@X555UB:~/python-ime/test-folder$ py.test maximo_2.py
=================== test session starts ======================
platform linux -- Python 3.8.5, pytest-6.1.1, py-1.9.0, pluggy-0.13.1
rootdir: /home/wander/python-ime/test-folder
collected 4 items

maximo_2.py ...F [100%]

======================== FAILURES =========================
______________________ test_maximo4 _________________________

def test_maximo4():
  assert maximo(1,100) == 1 # running a propsital wrong test

E assert 100 == 1
E + where 100 = maximo(1, 100)

maximo_2.py:26: AssertionError
=================== short test summary info =====================
FAILED maximo_2.py::test_maximo4 - assert 100 == 1
================== 1 failed, 3 passed in 0.08s ==================

Key versions and other information:

  • Spyder version: 4.1.5
  • Version of spyder-unittest plugin: 0.4.1
  • Installation method for Spyder and the unittest plugin: Anaconda
  • Python version: 3.8.5
  • Testing framework used: py.test
  • Testing framework version: 6.1.1
  • Operating system: Linux (elementary OS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions