From thom@@p85 @ending from gm@il@com  Mon Nov 12 14:09:32 2018
From: thom@@p85 @ending from gm@il@com (Thomas Lin Pedersen)
Date: Mon, 12 Nov 2018 14:09:32 +0100
Subject: [Rd] Better cleanup of example session during check
Message-ID: <39022329-7000-4081-812E-4A5887A33115@gmail.com>

I have a couple of packages (?fiery? and ?reqres') that uses a mock of a rook request for their examples. The mock is an R6 object containing a rawConnection, along with a finalizer that closes this connection when the object is removed. So far so good. I?ve recently been getting CRAN errors due to the rawConnection not being closed in examples

> cleanEx()
Error: connections left open:
	content (rawConnection)

and the only way to remove this is by removing the objects and calling gc() as part of the example code. While it is possible to hide all that inside a \dontshow{} block, it appears to me that it would be better if cleanEx() did a cleaning of the environment along with a single gc call prior to performing any checks on the end state. Is this something you would consider?

best
Thomas Lin Pedersen
	[[alternative HTML version deleted]]



[Rd] Better cleanup of example session during check
Thomas Lin Pedersen