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

pytest==6.0.0 breaks pytest-subtests #31

Closed
pmeier opened this issue Jul 29, 2020 · 2 comments · Fixed by #32
Closed

pytest==6.0.0 breaks pytest-subtests #31

pmeier opened this issue Jul 29, 2020 · 2 comments · Fixed by #32

Comments

@pmeier
Copy link

pmeier commented Jul 29, 2020

Content of test_subtests.py

def test_subtests(subtests):
    with subtests.test("foo"):
        assert True

Run with pytest==5.4.3

================================ test session starts =================================
platform linux -- Python 3.6.9, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
rootdir: /home/user
plugins: subtests-0.3.1
collected 1 item                                                                     

test_subtests.py ..                                                            [100%]

================================= 1 passed in 0.01s ==================================

Run with pytest==6.0.0

platform linux -- Python 3.6.9, pytest-6.0.0, py-1.9.0, pluggy-0.13.1
rootdir: /home/user
plugins: subtests-0.3.1
collected 1 item                                                                     

test_subtests.py F                                                             [100%]

====================================== FAILURES ======================================
___________________________________ test_subtests ____________________________________

subtests = SubTests(ihook=<pluggy.hooks._HookRelay object at 0x7f6abd329cf8>, suspend_capture_ctx=<bound method CaptureManager.gl...'suspended' _in_suspended=False> _capture_fixture=None>>, request=<SubRequest 'subtests' for <Function test_subtests>>)

    def test_subtests(subtests):
        with subtests.test("foo"):
>           assert True

test_subtests.py:3: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.6/contextlib.py:88: in __exit__
    next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = SubTests(ihook=<pluggy.hooks._HookRelay object at 0x7f6abd329cf8>, suspend_capture_ctx=<bound method CaptureManager.gl...'suspended' _in_suspended=False> _capture_fixture=None>>, request=<SubRequest 'subtests' for <Function test_subtests>>)
msg = 'foo', kwargs = {}, start = 6178.172653449, exc_info = None
captured = Captured(out='', err=''), stop = 6178.172874861

    @contextmanager
    def test(self, msg=None, **kwargs):
        start = monotonic()
        exc_info = None
    
        with self._capturing_output() as captured:
            try:
                yield
            except (Exception, OutcomeException):
                exc_info = ExceptionInfo.from_current()
    
        stop = monotonic()
    
>       call_info = CallInfo(None, exc_info, start, stop, when="call")
E       TypeError: __init__() missing 1 required positional argument: 'duration'

.venv/lib/python3.6/site-packages/pytest_subtests.py:161: TypeError
============================== short test summary info ===============================
FAILED test_subtests.py::test_subtests - TypeError: __init__() missing 1 required p...
================================= 1 failed in 0.03s ==================================
@nicoddemus
Copy link
Member

Ahhh thanks @pmeier for the report.

Will take a look ASAP. 👍

nicoddemus added a commit to nicoddemus/pytest-subtests that referenced this issue Aug 1, 2020
@nicoddemus
Copy link
Member

0.3.2 released, thanks for the report!

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

Successfully merging a pull request may close this issue.

2 participants