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

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

Open
BhuiyanMH opened this issue Jul 28, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@BhuiyanMH
Copy link

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'>
@giventocode giventocode added the bug Something isn't working label Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants