dmroeder / pylogix

Read/Write data from Allen Bradley Compact/Control Logix PLC's
Apache License 2.0
598 stars 182 forks source link

Tox.ini automated tests across multiple python versions #83

Closed TheFern2 closed 5 years ago

TheFern2 commented 5 years ago

NB: This merge depends on unittest PR #80 Do not merge until that one is merged, well actually it wouldn't hurt to merge first but tox will not run any tests. Once that is done, make sure to add plcConfig.py to tests folder with your plc configuration. Is explained in the README on unittest PR and shown below.

tests\plcConfig.py

plc_ip = '192.168.0.26'
plc_slot = 1
isMicro800 = False

Tox adds automation testing.

Install tox in the python version you code the most, then run tox once inside pylogix folder where setup.py and tox.ini reside.

pip install tox
tox

The first tox command will take a little bit longer as it is building all environments for each python version.

Output below of all tests passed in 4 python environments:

Ran 13 tests in 2.704s

OK
________________________________________________________ summary _________________________________________________________  
  py27: commands succeeded
  py34: commands succeeded
  py35: commands succeeded
  py37: commands succeeded
  congratulations :)