Skip to content

Variables starting with 'run_' are detected as test cases and hence failed tests in result #73

@BhuiyanMH

Description

@BhuiyanMH

Details

If a variable name starts with 'run_', it is detected as a test case. So, we have a failed test in the result.

Code

from runtime.nutterfixture import NutterFixture, tag

class TestFixture(NutterFixture):
  
    def __init__(self):
      self.run_not_a_test = 1
      super().__init__()
      
    def assertion_test_01(self):
      assert True

result = TestFixture().execute_tests()
print(result.to_string(), type(result))

Given result

Notebook: N/A - Lifecycle State: N/A, Result: N/A
Run Page URL: N/A
============================================================
FAILING TESTS
------------------------------------------------------------
not_a_test (8.499999239575118e-06 seconds)

Traceback (most recent call last):
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-3c24d4c3-2c7b-40f5-b888-7fb218c2a6af/lib/python3.8/site-packages/runtime/testcase.py", line 59, in execute_test
    raise NoTestCasesFoundError(
runtime.testcase.NoTestCasesFoundError: Both a run and an assertion are required for every test

NoTestCasesFoundError: Both a run and an assertion are required for every test

PASSING TESTS
------------------------------------------------------------
test_01 (3.399998604436405e-06 seconds)

============================================================
 <class 'common.testexecresults.TestExecResults'>

Expected Result

Notebook: N/A - Lifecycle State: N/A, Result: N/A
Run Page URL: N/A
============================================================
PASSING TESTS
------------------------------------------------------------
test_01 (5.500000042957254e-06 seconds)

============================================================
 <class 'common.testexecresults.TestExecResults'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions