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

add test for #93 relating to scrapy and pytest 5.4.0 #94

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
37 changes: 37 additions & 0 deletions testing/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,3 +996,40 @@ async def test_self_isinstance(self, foo):
testdir.makepyfile(test_file)
rr = testdir.run(*cmd_opts, timeout=timeout)
assert_outcomes(rr, {"passed": 1})


def test_scrapy____something(testdir, cmd_opts):
test_file = """
import sys

import twisted.internet.reactor
import twisted.internet.defer
import twisted.internet.protocol
import twisted.trial.unittest


class Protocol(twisted.internet.protocol.ProcessProtocol):
def __init__(self):
self.deferred = twisted.internet.defer.Deferred()

def processEnded(self, status):
self.deferred.callback(self)


class Test(twisted.trial.unittest.TestCase):
@twisted.internet.defer.inlineCallbacks
def test(self):
protocol = Protocol()
command = [sys.executable, '--version']

twisted.internet.reactor.spawnProcess(
protocol,
command[0],
command,
)

yield protocol.deferred
"""
testdir.makepyfile(test_file)
rr = testdir.run(*cmd_opts, timeout=timeout)
assert_outcomes(rr, {"passed": 1})