Skip to content

Compatibility with TestItems.jl #182

Description

@moble

I'm sure I'm not the only person who loves both this package and TestItems.jl. One of the features of TestItems.jl that I've been using is including test code inside my src directory. These are good for unit testing fundamental capabilities, whereas larger tests of behaviors related to multiple parts of the code are kept in the main tests directory. I suspect this has also helped Claude to get more context without me having to tell it to look at the tests specifically.

But this runs into two problems when I also use ExplicitImports.jl:

  1. I want to test (or at least use) non-public features from my package.
  2. The tests exist in a different module, so I have to qualify access to non-public names.

ExplicitImports flags both of these as self-qualified accesses (even though the test module is not actually the same module as the package) and accessing non-public names. It turns out that I can quiet these by doing — surprise! — an explicit import of the names inside the tests. But sometimes I have a second (say, less efficient but simpler) implementation by the same name but from a different module that I want to compare against in the test, so I really do need to use them as qualified names. Also, it's just surprising behavior.

Is there a way to turn off these tests just inside @testitem, @testsnippet, and @testmodule? Barring that, maybe some mention of this combination in the docs?

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