Skip to content

test() won't work after check() when S4 methods are involved #60

Closed
@garrettgman

Description

@garrettgman

...and vice versa

For example, after running

check("lubridate")

test produces the following error

test("lubridate")
Loading lubridate
Error: package slot missing from signature for generic ‘[<-’
  and classes Interval, ANY
  cannot use with duplicate class names (the package may need to be re-installed)

It seems test is trying to reload the S4 methods of lubridate, but gets confused because the methods are already loaded from check(). As a result, test isn't sure how to differentiate the methods it wants to load. The same thing happens when I run check() after test().

The error comes from R's behavior: The same thing happens outside of devtools if I try redefining existing S4 methods. I can use removeMethod("[<-,Interval,ANY") to postpone the error message until R encounters the next pre-existing S4 method - but I really need to remove all at once.

Can check() and test() remove S4 methods on exit?

Garrett

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions