Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Unable to start - no really working example found #8

Open
vlcinsky opened this issue Jul 19, 2016 · 0 comments
Open

Unable to start - no really working example found #8

vlcinsky opened this issue Jul 19, 2016 · 0 comments

Comments

@vlcinsky
Copy link

(Pyton 2.7.9, Debian Jessie)

README.md refers to some directory samples but it seems to be missing.

Examples in Sphinx documentation also do not provide complete usable application.

I had even problem to create a test suite which would collect at least one test case. For this purpose I took ramses-tech/ramses-example repository and added tests/test_api.py

import pytest
import ra

api = ra.api("example.raml", app="config:local.ini")


@api.resource("/users")
def users_resource(users):
    @pytest.fixture
    def two_hundred():
        return 200

    @users.get
    def get(req, two_hundred):
        response = req()
        assert response.status_code == two_hundred

Running:

$ py.test -sv tests/test_api.py --collect-only

did not find any test case.

If I introduced some type into raml or ini file names, the py.test complained about missing files (so it was processed and this was expected behaviour).

Having rather good knowledge of pytest I was wondering, how can py.test collect anything, when there is not test_??? function and no ra plugin was listed by $ py.test --trace-config|grep " ra ". When I explicitly enabled the plugin by $ py.test -p ra --trace-config|grep " ra " detected it, but $ py.test -p ra tests/test_api.py --collect-only did not find any test case.

I am really desperate now how to start.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant