-
Notifications
You must be signed in to change notification settings - Fork 30
Description
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.