Closed rnhmjoj closed 8 years ago
I think we should keep a version check in the tests somewhere too just in case someone tries to run the tests on python 3.3
To run the tests you use python setup.py test
, no? Shouldn't be possible either.
Hmm... Cricle ci uses coverage run -m unittest discover
I wasn't sure if that would trigger it. Maybe we can test it by lowering the python version in circle ci to make sure it errors out as expected?
That should do it. Anyway I'm not familiar with the test suit: I don't know how/whether is possible to test the setup.py
. Do I have to leave the check in pirate.py
and test against it?
I have no idea. Maybe we can test setup.py by just importing it in the test?
Nope. Importing setup.py causes the setup interface to run; everything after import setup
is not actually being loaded/executed.
python3 tests/test_version.py
usage: test_version.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: test_version.py --help [cmd1 cmd2 ...]
or: test_version.py --help-commands
or: test_version.py cmd --help
error: no commands supplied
EDIT: ok, I can just use __name__ == '__main__'
Looks like you got it to work. Shipit!
This way it should not even possible to install it on the wrong version.