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

Failing tests with NoneType object for app #56

Open
buschmann23 opened this issue Mar 18, 2021 · 2 comments
Open

Failing tests with NoneType object for app #56

buschmann23 opened this issue Mar 18, 2021 · 2 comments

Comments

@buschmann23
Copy link

When trying to run the tests, they all fail. Am I missing something?

PYTHONPATH=/home/abuild/rpmbuild/BUILDROOT/python-sphinx-jsonschema-1.16.7-0.x86_64/usr/lib/python3.6/site-packages
PYTHONDONTWRITEBYTECODE=1
pytest-3.6 --ignore=_build.python36 --ignore=_build.python38 -v --trace -rs
============================= test session starts ==============================
platform linux -- Python 3.6.13, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3.6
cachedir: .pytest_cache
rootdir: /home/abuild/rpmbuild/BUILD/sphinx-jsonschema-ab7262e105845c306604eef60803a76ec8ff955e
collecting ... collected 2 items

tests/test_overall.py::test_create ERROR                                 [ 50%]
tests/test_overall.py::test_string ERROR                                 [100%]

==================================== ERRORS ====================================
________________________ ERROR at setup of test_create _________________________

    @pytest.fixture
    def wideformat():
        state = Body(RSTStateMachine([], None))
        state.build_table = Mock()
        lineno = 1
        source = ''
        options = {}
        app = None
    
>       return wide_format.WideFormat(state, lineno, source, options, app)

tests/test_overall.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <sphinx-jsonschema.wide_format.WideFormat object at 0x7fd5da4f0e48>
state = <docutils.parsers.rst.states.Body object at 0x7fd5da4f04a8>, lineno = 1
source = '', options = {}, app = None

    def __init__(self, state, lineno, source, options, app):
        super(WideFormat, self).__init__()
        self.app = app
        self.trans = None
        self.lineno = lineno
        self.state = state
        self.filename = self._get_filename(source)
        self.nesting = 0
        self.ref_titles = {}
        self.target_pointer = '#'
    
        self.options = deepcopy(self.option_defaults)
>       self.options.update(app.config.jsonschema_options)
E       AttributeError: 'NoneType' object has no attribute 'config'

../../BUILDROOT/python-sphinx-jsonschema-1.16.7-0.x86_64/usr/lib/python3.6/site-packages/sphinx-jsonschema/wide_format.py:63: AttributeError
________________________ ERROR at setup of test_string _________________________

    @pytest.fixture
    def wideformat():
        state = Body(RSTStateMachine([], None))
        state.build_table = Mock()
        lineno = 1
        source = ''
        options = {}
        app = None
    
>       return wide_format.WideFormat(state, lineno, source, options, app)

tests/test_overall.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <sphinx-jsonschema.wide_format.WideFormat object at 0x7fd5da47f518>
state = <docutils.parsers.rst.states.Body object at 0x7fd5da47f198>, lineno = 1
source = '', options = {}, app = None

    def __init__(self, state, lineno, source, options, app):
        super(WideFormat, self).__init__()
        self.app = app
        self.trans = None
        self.lineno = lineno
        self.state = state
        self.filename = self._get_filename(source)
        self.nesting = 0
        self.ref_titles = {}
        self.target_pointer = '#'
    
        self.options = deepcopy(self.option_defaults)
>       self.options.update(app.config.jsonschema_options)
E       AttributeError: 'NoneType' object has no attribute 'config'

../../BUILDROOT/python-sphinx-jsonschema-1.16.7-0.x86_64/usr/lib/python3.6/site-packages/sphinx-jsonschema/wide_format.py:63: AttributeError
============================== 2 errors in 0.40s ===============================
@lnoor
Copy link
Owner

lnoor commented Mar 19, 2021

No you don't.
I began creating tests, ran out of time.
Then someone contributed a number of large changes and the tests weren't updated.
This is the result and it won't change soon unless someone is willing to put in the effort.

@lnoor lnoor closed this as completed Mar 19, 2021
@maresb
Copy link

maresb commented Apr 20, 2021

Would it make sense to leave this issue open? I was confused when I noticed this, checked the open issues, and saw no reference to it. Thanks!

@lnoor lnoor reopened this Apr 21, 2021
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

3 participants