[pytest-dev] plugins/pytest-qt and cx_Freeze

Florian Bruhin me at the-compiler.org
Thu Jun 18 17:21:10 CEST 2015


> Another solution would be to explicitly pass the plugin in the command line
> using `-p pytestq.plugin`.

Sorry for the double-post - I found an (IMHO) slightly better solution
:)

As said before I'm using a separate test executable, and I noticed
pytest.main takes a plugins-argument with a list of plugin entry
points.

I now changed the script to import the plugins and run pytest
accordingly:

https://github.com/The-Compiler/qutebrowser/commit/060a7ea044cfac140c53d84258dc2857d058dfc2

Contrary to the other solutions, this makes cx_Freeze realize it
should also freeze those modules, as they're imported in the script
which gets frozen - so there's less duplication.

The only thing I had to give cx_Freeze a little hint about is the
import of the PyQt5.QtTest module, as it's unused in my project
otherwise, but pytest-qt uses it - and it uses a compatibility layer
which causes cx_Freeze to not pick this up.

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20150618/e93e515b/attachment.sig>


More information about the pytest-dev mailing list