Skip to content

Incompatibility with pytest #34

@JonasMikaelMellin

Description

@JonasMikaelMellin

Since both pypreprocessor and pytest are doing things under the hood and are based on conflicting assumptions, it is hard to get them to work together. For example, to ensure that pypreprocessor is run before pytest, pypreprocessor is enforced by replacing all names with "test" with "txst" and then replace all occurrences of "txst" with "test" and then run pytest.

Also, to get a pypreprocessor specified file to work as part of a test case, it is necessary to do something like "sys.argv = sys.argv[1:]" since pypreprocessor assumes things about sys.argv that is not true when it is invoked under pytest (e.g., sys.argv[1] is not pointing to the pypreprocessed-augmented file, but to the script invoking it.

I have workarounds and got it to work for my own private purpose, but to make pypreprocessor useful together with pytest, they must be more compatible.

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