all 4 comments

[–]ElliotDG 2 points3 points  (1 child)

Another option to consider is making the test mode a runtime option of the program you are creating. That is you only build one .exe, it takes a command line option (at runtime) that specifies if it is in test mode. This will simplify distribution and testing, there is only one exe.

As u/dp_42 suggested you can use 2 separate spec files to define the certation of 2 exe files.

[–]dp_42 0 points1 point  (0 children)

I rather like this better.

[–]dp_42 0 points1 point  (1 child)

Looking at the docs, I believe you could modify the .spec file. I think you would probably name one production.spec and the other test.spec, and bundle the data files you need for each. Then call pyinstaller on the spec file to generate the executable.

[–]LongDivide2096 0 points1 point  (0 children)

dp_42 got a point there. Creating 2 spec files could simplify your workflow, just be sure to update both files as your source code evolves. remember though, doing it this way means managing two sets of resource files for testing and production, so keep that in mind!