chmp / ipytest

Pytest in IPython notebooks.
MIT License
314 stars 17 forks source link

Doesn't work with Google Colab #42

Closed borisbrodski closed 4 years ago

borisbrodski commented 4 years ago

Running this small test on Google Colab

%%run_pytest[clean] -qq

def test_example():
    assert [1, 2, 3] == [1, 2, 3]

results in exception:

/usr/local/lib/python3.6/dist-packages/pluggy/hooks.py:258: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/local/lib/python3.6/dist-packages/pluggy/manager.py:67: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/local/lib/python3.6/dist-packages/pluggy/manager.py:61: in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
/usr/local/lib/python3.6/dist-packages/ipytest/_pytest_support.py:143: in pytest_collect_file
    parent, fspath=path.new(ext=".py"), module=self.module
/usr/local/lib/python3.6/dist-packages/ipytest/_pytest_support.py:156: in from_parent
    self = super().from_parent(parent, fspath=fspath)
E   AttributeError: 'super' object has no attribute 'from_parent'
chmp commented 4 years ago

Thanks for reporting this issue. Could you try upgrading pytest? pip install -U pytest. The newer versions of ipytest require pytest>=5.4. I will release a version of ipytest with correctly tagged requirements over the weekend.

borisbrodski commented 4 years ago

Thank you very much! You saved my day 🥇

ipytest is just awesome!

chmp commented 4 years ago

Happy to help :)