Skip to content

init reactor greenlet earlier #13

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

Merged
merged 3 commits into from
Jan 11, 2018
Merged

Conversation

ybilopolov
Copy link
Contributor

@ybilopolov ybilopolov commented Jan 10, 2018

implement #12


def test_blocon_in_hook(testdir):
testdir.makeconftest("""
import pytest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can indent this as you will, makeconftest ensures the indent is correct:

def test_blocon_in_hook(testdir):
    testdir.makeconftest("""
        import pytest
        from twisted.internet import reactor, defer
        def pytest_configure(config):
            d = defer.Deferred()
            reactor.callLater(0.01, d.callback, 1)
            pytest.blockon(d)
    """)
    testdir.makepyfile("""
        from twisted.internet import reactor, defer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thanks, was just using the original file style. I've updated the indentation of other tests too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool thanks!

@ybilopolov
Copy link
Contributor Author

ybilopolov commented Jan 10, 2018

With this I believe there is no need to have init_twisted_greenlet in pytest namespace anymore (which was added in #10 to solve similar issue), updated the PR.

@vtitor vtitor merged commit c762733 into pytest-dev:master Jan 11, 2018
@vtitor
Copy link
Member

vtitor commented Jan 11, 2018

@ybilopolov Thanks for the great job.

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 this pull request may close these issues.

3 participants