EliAndrewC / sideboard

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

plugin template is deriving from non-existent test class #70

Closed robdennis closed 10 years ago

robdennis commented 10 years ago
2014-06-11 22:30:23,246 [WARNING] sideboard.internal.imports: error importing plugin drafts_as_a_service
Traceback (most recent call last):
  File "sideboard/internal/imports.py", line 324, in _discover_plugins
    importlib.import_module(module_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/rad3/development/sideboard/plugins/drafts-as-a-service/drafts_as_a_service/tests/__init__.py", line 5, in <module>
    from sideboard.tests import SideboardTest, SideboardServerTest

that doesn't actually exist anywhere. SideboardServerTest does, but it's in a different directory

robdennis commented 10 years ago

unsure the right answer here @EliAndrewC

What is the right base class (in master) for non-server tests

EliAndrewC commented 10 years ago

Whoops! I believe I fixed this as part of my still-not-merged Python 3 compatibility pull request.

There is no longer any base class for tests; everything is now handled with pytest fixtures. When I made that change I forgot to fix the paver create_plugin stuff, so the skeleton code now spits out an invalid test file. Sorry about that - like I said, it's fixed in the not-yet-merged pull request which I expect to merge over this coming weekend.

For now you can just delete the import stuff. Here's what that file looks like now:

from __future__ import unicode_literals
import pytest

# you can py.test-style test cases, with fixtures
@pytest.fixture
def boolean_true():
    return True

def test_something_simple_the_pytest_way(boolean_true):
    assert boolean_true != False

(Eventually we'll probably want some examples of using the Sideboard-provided fixtures.)

EliAndrewC commented 10 years ago

Since this is still a valid issue until #63 is merged, I'll leave it open until then.