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

strange behavior with empty dataprovider #21

Open
denkj opened this issue Aug 30, 2016 · 0 comments
Open

strange behavior with empty dataprovider #21

denkj opened this issue Aug 30, 2016 · 0 comments

Comments

@denkj
Copy link

denkj commented Aug 30, 2016

Example test class:

from unittest import TestCase

import lode_runner


class TestFirst(TestCase):
    @lode_runner.dataprovider([])
    def test_me(self, data):
        assert True

Results:

lode_runner --dataproviders-first test.py

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

nosetests --dataproviders-first test.py
----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

nosetests test.py

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

lode_runner test.py
E
======================================================================
ERROR: Failure: ValueError (no such test method in <class 'test.TestFirst'>: test_me)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.5/unittest/case.py", line 392, in __init__
    testMethod = getattr(self, methodName)
AttributeError: 'TestFirst' object has no attribute 'test_me'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/denis/dev/venvs/sabers-webapi-venv/lib/python3.5/site-packages/lode_runner/plugins/initializer.py", line 18, in wrapper
    result = test(*args, **kwargs)
  File "/home/denis/dev/venvs/sabers-webapi-venv/lib/python3.5/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/home/denis/dev/venvs/sabers-webapi-venv/lib/python3.5/site-packages/nose/loader.py", line 523, in makeTest
    return self._makeTest(obj, parent)
  File "/home/denis/dev/venvs/sabers-webapi-venv/lib/python3.5/site-packages/nose/loader.py", line 570, in _makeTest
    return self.loadTestsFromTestCase(obj)
  File "/home/denis/dev/venvs/sabers-webapi-venv/lib/python3.5/site-packages/lode_runner/core.py", line 50, in loadTestsFromTestCase
    return self.suiteClass(list(map(testCaseClass, test_case_names)))
  File "/usr/lib/python3.5/unittest/case.py", line 398, in __init__
    (self.__class__, methodName))
ValueError: no such test method in <class 'test.TestFirst'>: test_me

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant